From 80bc65beb108fb3a73e45e8ecc6ad0cd02ec30c2 Mon Sep 17 00:00:00 2001 From: kichik Date: Fri, 6 Oct 2017 18:23:05 +0000 Subject: [PATCH] support python 3 for building python 2.6 is no longer supported git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6921 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/NSIS Menu/SConscript | 20 ++++++++++---------- Contrib/System/SConscript | 2 +- Docs/src/history.but | 10 ++++++++++ SCons/Tools/mstoolkit.py | 2 +- SCons/utils.py | 4 ++-- Source/Tests/SConscript | 2 +- Source/Tests/icons.py | 2 +- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/Contrib/NSIS Menu/SConscript b/Contrib/NSIS Menu/SConscript index 6968ce63..9fa34819 100644 --- a/Contrib/NSIS Menu/SConscript +++ b/Contrib/NSIS Menu/SConscript @@ -81,20 +81,20 @@ if env['PLATFORM'] != 'win32' and WhereIs('wx-config') or \ nsis_menu[0].env.ParseConfig('wx-config --cxxflags --libs') # install menu files - - env.DistributeMenu(html, alias='install-utils') - env.DistributeMenu(images, path='images', alias='install-utils') - if env['PLATFORM'] != 'win32': - env.DistributeBin(resources); - -else: - + + env.DistributeMenu(html, alias='install-utils') + env.DistributeMenu(images, path='images', alias='install-utils') + if env['PLATFORM'] != 'win32': + env.DistributeBin(resources); + +else: + # no wxWidgets def err(target, source, env): if env['PLATFORM'] == 'win32': - print '*** error: WXWIN must be set to build NSIS Menu!' + print('*** error: WXWIN must be set to build NSIS Menu!') else: - print '*** error: wx-config must be in the PATH to build NSIS Menu!' + print('*** error: wx-config must be in the PATH to build NSIS Menu!') return 1 cmd = env.Command(target, files, Action(err, '')) diff --git a/Contrib/System/SConscript b/Contrib/System/SConscript index f86dea20..ef2ca3f1 100644 --- a/Contrib/System/SConscript +++ b/Contrib/System/SConscript @@ -50,7 +50,7 @@ elif (not msvc) and conf.TryCompile(src_ascpp, '.S'): elif (not msvc) and conf.TryCompile(src_ascpp, '.sx'): files += ['Source/'+filename+'CPP.sx'] else: - print 'WARNING: System.dll: unable to find assembler for '+filename+'.S' + print('WARNING: System.dll: unable to find assembler for '+filename+'.S') conf.Finish() BuildPlugin( diff --git a/Docs/src/history.but b/Docs/src/history.but index 41ba8bcc..eed433b2 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -4,6 +4,10 @@ Released on ??? ??rd, 20?? +\S1{v3.03-rn} Release Notes + +\b Building NSIS with Python 2.6 or older is no longer supported + \S1{v3.03-cl} Changelog \S2{} Major Changes @@ -18,6 +22,12 @@ Released on ??? ??rd, 20?? \b Removed unused NSD_LB_Clear macro parameter +\S2{} Build System + +\b Added support for Python 3 + +\b Dropped support for Python 2.6 and older + \H{v3.02.1} 3.02.1 Released on July 31st, 2017 diff --git a/SCons/Tools/mstoolkit.py b/SCons/Tools/mstoolkit.py index d19ee3e9..4033260e 100644 --- a/SCons/Tools/mstoolkit.py +++ b/SCons/Tools/mstoolkit.py @@ -229,7 +229,7 @@ def RegServerFunc(target, source, env): if ret: raise SCons.Errors.UserError, "Unable to register %s" % target[0] else: - print "Registered %s sucessfully" % target[0] + print("Registered %s sucessfully" % target[0]) return ret return 0 diff --git a/SCons/utils.py b/SCons/utils.py index 9528c53b..1a54b111 100644 --- a/SCons/utils.py +++ b/SCons/utils.py @@ -27,7 +27,7 @@ def AddZLib(env, platform, alias='install-utils'): if 'ZLIB_W32_NEW_DLL' in env and env['ZLIB_W32_NEW_DLL']: env.DistributeW32Bin(env['ZLIB_W32_NEW_DLL'], alias=alias) else: - print 'Please specify folder of zlib for Win32 via ZLIB_W32' + print('Please specify folder of zlib for Win32 via ZLIB_W32') Exit(1) # Avoid unnecessary configuring when cleaning targets @@ -35,7 +35,7 @@ def AddZLib(env, platform, alias='install-utils'): if not env.GetOption('clean'): conf = env.Configure() if not conf.CheckLibWithHeader(zlib, 'zlib.h', 'c'): - print 'zlib (%s) is missing!' % (platform) + print('zlib (%s) is missing!' % (platform)) Exit(1) env = conf.Finish() diff --git a/Source/Tests/SConscript b/Source/Tests/SConscript index eccd9628..b197a2f3 100644 --- a/Source/Tests/SConscript +++ b/Source/Tests/SConscript @@ -157,7 +157,7 @@ else: # no CppUnit def err(target, source, env): - print '*** error: CppUnit must be installed for testing!' + print('*** error: CppUnit must be installed for testing!') return 1 cmd = env.Command(target, [tests], Action(err, '')) diff --git a/Source/Tests/icons.py b/Source/Tests/icons.py index fce17813..bfeff1b8 100644 --- a/Source/Tests/icons.py +++ b/Source/Tests/icons.py @@ -20,7 +20,7 @@ def build(icon, unicon): pw, pr = popen2(r'C:\Progra~1\NSIS\makensis.exe -') pw.write(SCRIPT % locals()) pw.close() - print pr.read() + print(pr.read()) from glob import glob from os import system