summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2018-07-12 09:02:56 (GMT)
committerTobias Markmann <tm@ayena.de>2018-07-12 09:02:56 (GMT)
commit95b04304452c4cf0a01f676a12779dacc6fa51a4 (patch)
tree9a8dce3db8213b68901893a0a6d371243684c3ee
parent2bb40b14d3d7f5cebc56601dad066d5201040bd2 (diff)
downloadswift-95b04304452c4cf0a01f676a12779dacc6fa51a4.zip
swift-95b04304452c4cf0a01f676a12779dacc6fa51a4.tar.bz2
Fix Python 3 compatibility of our SCons and tooling Python code
For the upcoming update to Scons 3, which works with Python 2 and Python 3, this change makes our code compatible with Python 3 so that it still works with Python 2. Test-Information: Tested these changes with SCons 3.0.1 on macOS 10.13.6 with Python 2.7.15 and Python 3.7.0. Change-Id: Idb5207b179a79a0dbe89d7e620d182a7d2f1ca6c
-rw-r--r--3rdParty/LibIDN/SConscript4
-rwxr-xr-xBuildTools/CheckHeaders.py2
-rwxr-xr-xBuildTools/CheckTranslations.py8
-rwxr-xr-xBuildTools/Copyright/find-contribs.py6
-rwxr-xr-xBuildTools/Copyrighter.py14
-rw-r--r--BuildTools/CrashReportAnalysis/WindowsMinidumpAnalyse.py8
-rw-r--r--BuildTools/DocBook/SCons/XSLT.py2
-rwxr-xr-xBuildTools/FixIncludes.py4
-rwxr-xr-xBuildTools/GetBuildVersion.py2
-rwxr-xr-xBuildTools/Gource/GetGravatars.py14
-rw-r--r--BuildTools/SCons/SConstruct48
-rw-r--r--BuildTools/SCons/Tools/AppBundle.py4
-rw-r--r--BuildTools/SCons/Tools/InstallWithSymLinks.py8
-rw-r--r--BuildTools/SCons/Tools/qt4.py22
-rw-r--r--BuildTools/SCons/Tools/textfile.py2
-rw-r--r--BuildTools/SCons/Version.py6
-rwxr-xr-xBuildTools/scons2ninja.py2
-rw-r--r--Slimber/SConscript4
-rw-r--r--Sluift/SConscript2
-rw-r--r--Swift/Packaging/SConscript2
-rw-r--r--Swift/QtUI/SConscript8
-rw-r--r--Swift/SConscript6
22 files changed, 89 insertions, 89 deletions
diff --git a/3rdParty/LibIDN/SConscript b/3rdParty/LibIDN/SConscript
index 90892b0..c99aff8 100644
--- a/3rdParty/LibIDN/SConscript
+++ b/3rdParty/LibIDN/SConscript
@@ -42,3 +42,3 @@ if env.get("LIBIDN_BUNDLED", False) :
else :
- print "Error: Cannot find strcasecmp() or stricmp()"
+ print("Error: Cannot find strcasecmp() or stricmp()")
Exit(1)
@@ -48,3 +48,3 @@ if env.get("LIBIDN_BUNDLED", False) :
else :
- print "Error: Cannot find strncasecmp() or strnicmp()"
+ print("Error: Cannot find strncasecmp() or strnicmp()")
Exit(1)
diff --git a/BuildTools/CheckHeaders.py b/BuildTools/CheckHeaders.py
index 79ff85c..752d257 100755
--- a/BuildTools/CheckHeaders.py
+++ b/BuildTools/CheckHeaders.py
@@ -38,3 +38,3 @@ for line in file.readlines() :
if forbiddenInclude in line and len([x for x in ignores if x in filename]) == 0 :
- print "Found " + forbiddenInclude + " include in " + filename
+ print("Found " + forbiddenInclude + " include in " + filename)
foundBadHeaders = True
diff --git a/BuildTools/CheckTranslations.py b/BuildTools/CheckTranslations.py
index 615f81f..0617fba 100755
--- a/BuildTools/CheckTranslations.py
+++ b/BuildTools/CheckTranslations.py
@@ -43,8 +43,8 @@ for filename in os.listdir("Swift/Translations") :
if translationPlaceholders != sourcePlaceholders :
- print "[Error] " + filename + ": Placeholder mismatch in translation '" + sourceText + "'"
+ print("[Error] " + filename + ": Placeholder mismatch in translation '" + sourceText + "'")
if not finished :
- print "[Warning] " + filename + ": Unfinished"
+ print("[Warning] " + filename + ": Unfinished")
if language not in desktop_generic_names and language != "en" :
- print "[Warning] GenericName field missing in desktop entry for " + language
+ print("[Warning] GenericName field missing in desktop entry for " + language)
if language not in desktop_comments and language != "en" :
- print "[Warning] Comment field missing in desktop entry for " + language
+ print("[Warning] Comment field missing in desktop entry for " + language)
diff --git a/BuildTools/Copyright/find-contribs.py b/BuildTools/Copyright/find-contribs.py
index ac30afb..799ae7b 100755
--- a/BuildTools/Copyright/find-contribs.py
+++ b/BuildTools/Copyright/find-contribs.py
@@ -48,3 +48,3 @@ full_swiften_log = subprocess.check_output(["git", "log", "--", "Swiften"])
-print "Contributors for Swiften/ subtree:\n"
+print("Contributors for Swiften/ subtree:\n")
print_log(full_swiften_log)
@@ -53,5 +53,5 @@ full_all_log = subprocess.check_output(["git", "log"])
-print "\n\n\n\n"
+print("\n\n\n\n")
-print "Contributors for full tree:\n"
+print("Contributors for full tree:\n")
print_log(full_all_log)
diff --git a/BuildTools/Copyrighter.py b/BuildTools/Copyrighter.py
index a16050c..cfde98f 100755
--- a/BuildTools/Copyrighter.py
+++ b/BuildTools/Copyrighter.py
@@ -124,6 +124,6 @@ def check_copyright(filename, hints) :
if hints :
- print "Copyright block for " + copyrightSetting.author + " does not cover current year in: " + filename
+ print("Copyright block for " + copyrightSetting.author + " does not cover current year in: " + filename)
return False
if hints :
- print "Missing copyright block for " + copyrightSetting.author + " in: " + filename
+ print("Missing copyright block for " + copyrightSetting.author + " in: " + filename)
return False
@@ -131,3 +131,3 @@ def check_copyright(filename, hints) :
if hints :
- print "No copyright found in: " + filename
+ print("No copyright found in: " + filename)
return False
@@ -142,3 +142,3 @@ def set_or_update_copyright(filename) :
if check_copyright(filename, False) :
- print "No update required for file: " + filename
+ print("No update required for file: " + filename)
else :
@@ -163,3 +163,3 @@ def set_or_update_copyright(filename) :
def print_help() :
- print """Usage:
+ print("""Usage:
Copyrighter.py check-copyright $filename
@@ -174,3 +174,3 @@ def print_help() :
$license are default, mit and gpl.
- """
+ """)
@@ -185,3 +185,3 @@ elif sys.argv[1] == "set-copyright" :
else :
- print "Unknown command: " + sys.argv[1]
+ print("Unknown command: " + sys.argv[1])
print_help()
diff --git a/BuildTools/CrashReportAnalysis/WindowsMinidumpAnalyse.py b/BuildTools/CrashReportAnalysis/WindowsMinidumpAnalyse.py
index de0633d..19e5f87 100644
--- a/BuildTools/CrashReportAnalysis/WindowsMinidumpAnalyse.py
+++ b/BuildTools/CrashReportAnalysis/WindowsMinidumpAnalyse.py
@@ -21,3 +21,3 @@ swiftWindowBuildsPathPrefix = os.getenv("SWIFT_DIST")
if swiftWindowBuildsPathPrefix == None :
- print "Please set the SWIFT_DIST environment variable to a location containing msi and pdb.gz files."
+ print("Please set the SWIFT_DIST environment variable to a location containing msi and pdb.gz files.")
sys.exit(1)
@@ -25,3 +25,3 @@ if swiftWindowBuildsPathPrefix == None :
if len(sys.argv) != 3:
- print "Usage: python WindowsMinidumpAnalyse.py VERSION MINIDUMP_FILE"
+ print("Usage: python WindowsMinidumpAnalyse.py VERSION MINIDUMP_FILE")
sys.exit(1)
@@ -95,3 +95,3 @@ try:
except:
- print ""
+ print("")
@@ -122,3 +122,3 @@ if not os.path.exists(symbol_cache_path):
-#print "Checking out commit {0}.".format(commit)
+#print("Checking out commit {0}.".format(commit))
call(["git", "-C", working_folder, "checkout", commit])
diff --git a/BuildTools/DocBook/SCons/XSLT.py b/BuildTools/DocBook/SCons/XSLT.py
index 38e36c5..6a40b62 100644
--- a/BuildTools/DocBook/SCons/XSLT.py
+++ b/BuildTools/DocBook/SCons/XSLT.py
@@ -10,3 +10,3 @@ def generate(env) :
if not env.has_key("XSLTSTYLESHEET") :
- raise SCons.Errors.UserError, "The XSLTSTYLESHEET construction variable must be defined"
+ raise SCons.Errors.UserError("The XSLTSTYLESHEET construction variable must be defined")
diff --git a/BuildTools/FixIncludes.py b/BuildTools/FixIncludes.py
index 8984944..e532464 100755
--- a/BuildTools/FixIncludes.py
+++ b/BuildTools/FixIncludes.py
@@ -155,3 +155,3 @@ for line in content[headerStart:headerEnd]:
if containsComplexPreprocessorDirectives:
- print "Cannot format headers containing preprocessor #if, #pragma, #define or #undef statements!"
+ print("Cannot format headers containing preprocessor #if, #pragma, #define or #undef statements!")
exit(1)
@@ -160,3 +160,3 @@ if filename_base.endswith(".h"):
if not HeaderType.PRAGMA_ONCE in headerGroups:
- print "Missing #pragma once!"
+ print("Missing #pragma once!")
exit(2)
diff --git a/BuildTools/GetBuildVersion.py b/BuildTools/GetBuildVersion.py
index 70fdc5c..be7cc03 100755
--- a/BuildTools/GetBuildVersion.py
+++ b/BuildTools/GetBuildVersion.py
@@ -18,3 +18,3 @@ if only_major :
else :
- print "0"
+ print("0")
else :
diff --git a/BuildTools/Gource/GetGravatars.py b/BuildTools/Gource/GetGravatars.py
index d1f40a4..17198aa 100755
--- a/BuildTools/Gource/GetGravatars.py
+++ b/BuildTools/Gource/GetGravatars.py
@@ -7,3 +7,3 @@ GRAVATAR_URL = "http://www.gravatar.com/avatar/%(id)s?d=404"
if len(sys.argv) != 2 :
- print "Usage: " + sys.argv[0] + " <output-dir>"
+ print("Usage: " + sys.argv[0] + " <output-dir>")
sys.exit(-1)
@@ -20,3 +20,3 @@ p.stdin.close()
if p.wait() != 0 :
- print "Error"
+ print("Error")
sys.exit(-1)
@@ -27,6 +27,6 @@ if not os.path.isdir(output_dir) :
for email, name in authors.items() :
- print "Processing avatar for " + name + " <" + email + ">"
+ print("Processing avatar for " + name + " <" + email + ">")
filename = os.path.join(output_dir, name + ".png")
if os.path.isfile(filename) :
- print "-> Already there. Skipping."
+ print("-> Already there. Skipping.")
continue
@@ -36,3 +36,3 @@ for email, name in authors.items() :
url = GRAVATAR_URL % {"id" : m.hexdigest()}
- print "- Downloading " + url
+ print("- Downloading " + url)
f = urllib.urlopen(url)
@@ -43,3 +43,3 @@ for email, name in authors.items() :
if input :
- print "- Saving file " + filename
+ print("- Saving file " + filename)
f = open(filename, "w")
@@ -48,2 +48,2 @@ for email, name in authors.items() :
else :
- print "- No Gravatar found"
+ print("- No Gravatar found")
diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct
index 55b604b..78f388b 100644
--- a/BuildTools/SCons/SConstruct
+++ b/BuildTools/SCons/SConstruct
@@ -9,5 +9,5 @@ root = Dir("../..").abspath
oldSConscript = SConscript
-def SConscript(*arguments, **keywords) :
- if not keywords.get("test_only", False) or env["TEST"] :
- return apply(oldSConscript, arguments, keywords)
+def SConscript(*args, **kwargs) :
+ if not kwargs.get("test_only", False) or env["TEST"] :
+ return oldSConscript(*args, **kwargs)
env.SConscript = SConscript
@@ -144,3 +144,3 @@ conf = Configure(conf_env, custom_tests = {
if not conf.CheckCXX() or not conf.CheckCC() :
- print "Error: You need a working compiler"
+ print("Error: You need a working compiler")
Exit(1)
@@ -148,3 +148,3 @@ if not conf.CheckCXX() or not conf.CheckCC() :
if not conf.CheckCpp11Support() :
- print "Error: You need a compiler with support for the C++11 standard"
+ print("Error: You need a compiler with support for the C++11 standard")
Exit(1)
@@ -172,3 +172,3 @@ if zlib_okay :
elif not env.get("zlib_bundled_enable", True) :
- print "Error: Zlib not found and zlib_bundled_enable is false"
+ print("Error: Zlib not found and zlib_bundled_enable is false")
Exit(1)
@@ -240,3 +240,3 @@ if not env.get("boost_force_bundled") and allLibsPresent :
elif not env.get("boost_bundled_enable", True) :
- print "Error: Boost not found and boost_bundled_enable is false"
+ print("Error: Boost not found and boost_bundled_enable is false")
Exit(1)
@@ -375,3 +375,3 @@ bundledExpat = False
if not env.get("HAVE_EXPAT", 0) and not env.get("HAVE_LIBXML", 0) :
- print "Expat or LibXML not found. Using bundled Expat"
+ print("Expat or LibXML not found. Using bundled Expat")
SConscript("#/3rdParty/Expat/SConscript")
@@ -426,6 +426,6 @@ if not env.get("HAVE_ICU", False) and not env.get("HAVE_LIBIDN", False) :
elif env.get("need_idn", True):
- print "Error: ICU and LIBIDN not found, and libidn_bundled_enable is false"
+ print("Error: ICU and LIBIDN not found, and libidn_bundled_enable is false")
Exit(1)
else:
- print "Proceeding without an IDN library because need_idn was false. This will break all internal binaries"
+ print("Proceeding without an IDN library because need_idn was false. This will break all internal binaries")
@@ -516,3 +516,3 @@ if not env.get("lua_force_bundled", False) and conf.CheckLibWithHeader(env["lua_
else :
- print "Warning: Unable to determine Lua version. Not installing Lua libraries."
+ print("Warning: Unable to determine Lua version. Not installing Lua libraries.")
env["LUA_FLAGS"].update(lua_flags)
@@ -672,3 +672,3 @@ except SCons.Errors.StopError:
except Exception as e:
- print "Info: %s" % str(e)
+ print("Info: %s" % str(e))
env["HAVE_QT"] = False
@@ -694,3 +694,3 @@ try:
except TypeError:
- print "You seem to be using Swift in a Git submodule. Not installing hooks."
+ print("You seem to be using Swift in a Git submodule. Not installing hooks.")
@@ -760,3 +760,3 @@ for stage in ["flags", "build"] :
env["SCONS_STAGE"] = stage
- SConscript(dirs = map(lambda x : root + "/" + x, modules))
+ SConscript(dirs = list(map(lambda x : root + "/" + x, modules)))
@@ -772,5 +772,5 @@ if ARGUMENTS.get("sloccount", False) :
-print
-print " Build Configuration"
-print " -------------------"
+print("")
+print(" Build Configuration")
+print(" -------------------")
@@ -783,12 +783,12 @@ if env.get("HAVE_EXPAT", 0):
parsers.append("(Bundled)")
-print " Projects: " + ' '.join(env["PROJECTS"])
-print ""
-print " XML Parsers: " + ' '.join(parsers)
+print(" Projects: " + ' '.join(env["PROJECTS"]))
+print("")
+print(" XML Parsers: " + ' '.join(parsers))
-print " TLS Support: " + (env.get("HAVE_OPENSSL",0) and "OpenSSL" or env.get("HAVE_SECURETRANSPORT",0) and "Secure Transport" or env.get("HAVE_SCHANNEL", 0) and "Schannel" or "Disabled")
-print " DNSSD Support: " + (env.get("HAVE_BONJOUR") and "Bonjour" or (env.get("HAVE_AVAHI") and "Avahi" or "Disabled"))
-print
+print(" TLS Support: " + (env.get("HAVE_OPENSSL",0) and "OpenSSL" or env.get("HAVE_SECURETRANSPORT",0) and "Secure Transport" or env.get("HAVE_SCHANNEL", 0) and "Schannel" or "Disabled"))
+print(" DNSSD Support: " + (env.get("HAVE_BONJOUR") and "Bonjour" or (env.get("HAVE_AVAHI") and "Avahi" or "Disabled")))
+print("")
if not GetOption("help") and not env.get("HAVE_OPENSSL", 0) and not env.get("HAVE_SCHANNEL", 0) and not env.get("HAVE_SECURETRANSPORT", 0):
- print "Error: A working TLS backend is required. Please check the documentation for more information."
+ print("Error: A working TLS backend is required. Please check the documentation for more information.")
Exit(1)
diff --git a/BuildTools/SCons/Tools/AppBundle.py b/BuildTools/SCons/Tools/AppBundle.py
index 337e83f..31cfef1 100644
--- a/BuildTools/SCons/Tools/AppBundle.py
+++ b/BuildTools/SCons/Tools/AppBundle.py
@@ -36,3 +36,3 @@ def generate(env) :
plist += "<key>" + key + "</key>\n"
- plist += "<string>" + value.encode("utf-8") + "</string>\n"
+ plist += "<string>" + value + "</string>\n"
if handlesXMPPURIs :
@@ -52,3 +52,3 @@ def generate(env) :
plist += "<key>SUPublicDSAKeyFile</key>"
- plist += "<string>" + sparklePublicDSAKey.name.encode("utf-8") + "</string>"
+ plist += "<string>" + sparklePublicDSAKey.name + "</string>"
env.Install(resourcesDir, sparklePublicDSAKey)
diff --git a/BuildTools/SCons/Tools/InstallWithSymLinks.py b/BuildTools/SCons/Tools/InstallWithSymLinks.py
index 23d12ed..4955192 100644
--- a/BuildTools/SCons/Tools/InstallWithSymLinks.py
+++ b/BuildTools/SCons/Tools/InstallWithSymLinks.py
@@ -76,3 +76,3 @@ def scons_copytree(src, dst, symlinks=False):
# XXX What about devices, sockets etc.?
- except (IOError, os.error), why:
+ except (IOError, os.error) as why:
errors.append((srcname, dstname, str(why)))
@@ -80,3 +80,3 @@ def scons_copytree(src, dst, symlinks=False):
# continue with other files
- except CopytreeError, err:
+ except CopytreeError as err:
errors.extend(err.args[0])
@@ -87,6 +87,6 @@ def scons_copytree(src, dst, symlinks=False):
pass
- except OSError, why:
+ except OSError as why:
errors.extend((src, dst, str(why)))
if errors:
- raise CopytreeError, errors
+ raise CopytreeError(errors)
diff --git a/BuildTools/SCons/Tools/qt4.py b/BuildTools/SCons/Tools/qt4.py
index e859017..372b261 100644
--- a/BuildTools/SCons/Tools/qt4.py
+++ b/BuildTools/SCons/Tools/qt4.py
@@ -142,4 +142,4 @@ class _Automoc:
for obj in source:
- if isinstance(obj,basestring): # big kludge!
- print "scons: qt4: '%s' MAYBE USING AN OLD SCONS VERSION AND NOT CONVERTED TO 'File'. Discarded." % str(obj)
+ if isinstance(obj,str): # big kludge!
+ print("scons: qt4: '%s' MAYBE USING AN OLD SCONS VERSION AND NOT CONVERTED TO 'File'. Discarded." % str(obj))
continue
@@ -148,3 +148,3 @@ class _Automoc:
if debug:
- print "scons: qt: '%s' seems to be a binary. Discarded." % str(obj)
+ print("scons: qt: '%s' seems to be a binary. Discarded." % str(obj))
continue
@@ -153,3 +153,3 @@ class _Automoc:
if debug:
- print "scons: qt: '%s' is no cxx file. Discarded." % str(cpp)
+ print("scons: qt: '%s' is no cxx file. Discarded." % str(cpp) )
# c or fortran source
@@ -158,3 +158,3 @@ class _Automoc:
try:
- cpp_contents = cpp.get_contents()
+ cpp_contents = str(cpp.get_contents())
except: continue # may be an still not generated source
@@ -168,8 +168,8 @@ class _Automoc:
if debug:
- print "scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp))
+ print("scons: qt: Scanning '%s' (header of '%s')" % (str(h), str(cpp)))
#h_contents = comment.sub('', h.get_contents())
- h_contents = h.get_contents()
+ h_contents = str(h.get_contents())
break
if not h and debug:
- print "scons: qt: no header for '%s'." % (str(cpp))
+ print("scons: qt: no header for '%s'." % (str(cpp)))
if h and q_object_search.search(h_contents):
@@ -181,3 +181,3 @@ class _Automoc:
if debug:
- print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp))
+ print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(h), str(moc_cpp)))
if cpp and q_object_search.search(cpp_contents):
@@ -188,3 +188,3 @@ class _Automoc:
if debug:
- print "scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc))
+ print("scons: qt: found Q_OBJECT macro in '%s', moc'ing to '%s'" % (str(cpp), str(moc)))
#moc.source_scanner = SCons.Defaults.CScan
@@ -349,3 +349,3 @@ def generate(env):
return result
- contents = node.get_contents()
+ contents = str(node.get_contents())
includes = [included[1] for included in qrcinclude_re.findall(contents)]
diff --git a/BuildTools/SCons/Tools/textfile.py b/BuildTools/SCons/Tools/textfile.py
index 9b424f2..02fc54a 100644
--- a/BuildTools/SCons/Tools/textfile.py
+++ b/BuildTools/SCons/Tools/textfile.py
@@ -109,3 +109,3 @@ def _action(target, source, env):
fd = open(target[0].get_path(), "wb")
- except (OSError,IOError), e:
+ except (OSError,IOError) as e:
raise SCons.Errors.UserError("Can't write target file %s" % target[0])
diff --git a/BuildTools/SCons/Version.py b/BuildTools/SCons/Version.py
index d34c2a7..b69cdca 100644
--- a/BuildTools/SCons/Version.py
+++ b/BuildTools/SCons/Version.py
@@ -8,3 +8,3 @@ def getGitBuildVersion(root, project) :
if tag :
- m = re.match(project + "-(.*)-(.*)-(.*)", tag)
+ m = re.match(project + "-(.*)-(.*)-(.*)", tag.decode('utf-8'))
if m :
@@ -19,3 +19,3 @@ def git(cmd, root) :
# if error:
- # print "Git error: " + error
+ # print("Git error: " + error)
p.stdin.close()
@@ -40,3 +40,3 @@ def getBuildVersion(root, project) :
def convertToWindowsVersion(version) :
- version_match = re.match("(\d+)\.(\d+)(.*)", version)
+ version_match = re.match("(\d+)\.(\d+)(.*)", version.decode('utf-8'))
major = version_match and int(version_match.group(1)) or 0
diff --git a/BuildTools/scons2ninja.py b/BuildTools/scons2ninja.py
index 6c77c88..855a133 100755
--- a/BuildTools/scons2ninja.py
+++ b/BuildTools/scons2ninja.py
@@ -431,3 +431,3 @@ for line in f.stdout :
if f.wait() != 0 :
- print "Error calling '" + scons_generate_cmd + "'"
+ print("Error calling '" + scons_generate_cmd + "'")
print f.stderr.read()
diff --git a/Slimber/SConscript b/Slimber/SConscript
index a41fe0b..fa5aa53 100644
--- a/Slimber/SConscript
+++ b/Slimber/SConscript
@@ -13,6 +13,6 @@ elif env["PLATFORM"] != "darwin" :
if not "Slimber" in env["PROJECTS"] and env["SCONS_STAGE"] == "flags" :
- print "Bonjour missing. Not building Slimber."
+ print("Bonjour missing. Not building Slimber.")
if not env.get("HAVE_QT", False) and "Slimber" in env["PROJECTS"] :
- print "Qt missing. Not building Slimber."
+ print("Qt missing. Not building Slimber.")
env["PROJECTS"].remove("Slimber")
diff --git a/Sluift/SConscript b/Sluift/SConscript
index de9cab6..af54ece 100644
--- a/Sluift/SConscript
+++ b/Sluift/SConscript
@@ -5,3 +5,3 @@ Import(["env"])
if env["SCONS_STAGE"] == "build" and not GetOption("help") and not env.get("HAVE_LUA", 0) :
- print "Warning: Lua was not found. Sluift will not be built."
+ print("Warning: Lua was not found. Sluift will not be built.")
if "Sluift" in env["PROJECTS"] :
diff --git a/Swift/Packaging/SConscript b/Swift/Packaging/SConscript
index 3aa791f..556c596 100644
--- a/Swift/Packaging/SConscript
+++ b/Swift/Packaging/SConscript
@@ -27,3 +27,3 @@ if env["SCONS_STAGE"] == "build" :
else:
- print "Enabled help2man but help2man is not in the PATH of the current environment."
+ print("Enabled help2man but help2man is not in the PATH of the current environment.")
Exit(1)
diff --git a/Swift/QtUI/SConscript b/Swift/QtUI/SConscript
index 8ee82e4..29aa8b8 100644
--- a/Swift/QtUI/SConscript
+++ b/Swift/QtUI/SConscript
@@ -29,3 +29,3 @@ myenv = env.Clone()
# Disable warnings that affect Qt
-myenv["CXXFLAGS"] = filter(lambda x : x != "-Wfloat-equal", myenv["CXXFLAGS"])
+myenv["CXXFLAGS"] = list(filter(lambda x : x != "-Wfloat-equal", myenv["CXXFLAGS"]))
if "clang" in env["CC"] :
@@ -514,3 +514,3 @@ if env["PLATFORM"] == "win32" :
for x in range (1, 4) :
- print "Attemping to sign the packages [%s]" % x
+ print("Attemping to sign the packages [%s]" % x)
signresult = env.Execute('signtool.exe sign /fd SHA256 /f "${SIGNTOOL_KEY_PFX}" /t "${SIGNTOOL_TIMESTAMP_URL}" /d "Swift Installer" ' + str(target[0]))
@@ -520,6 +520,6 @@ if env["PLATFORM"] == "win32" :
if signresult == 1 :
- print "Error: The build has failed to sign the installer package"
+ print("Error: The build has failed to sign the installer package")
Exit(1)
if signresult == 2 :
- print "Signing was completed with warnings."
+ print("Signing was completed with warnings.")
diff --git a/Swift/SConscript b/Swift/SConscript
index b211435..30b09e0 100644
--- a/Swift/SConscript
+++ b/Swift/SConscript
@@ -9,3 +9,3 @@ if env["SCONS_STAGE"] == "build" :
if "Swift" in env["PROJECTS"] :
- print "Warning: Swift requires Qt. Not building the Swift Qt application."
+ print("Warning: Swift requires Qt. Not building the Swift Qt application.")
env["PROJECTS"].remove("Swift")
@@ -15,3 +15,3 @@ if env["SCONS_STAGE"] == "build" :
except Exception as e:
- print "Warning: %s" % str(e)
+ print("Warning: %s" % str(e))
env["PROJECTS"].remove("Swift")
@@ -19,3 +19,3 @@ if "Swift" in env["PROJECTS"] and env["BOOST_1_64_DETECTED"] and not env.get("al
#Version 1.64 has some issues with the serialization of boost::optional, see https://svn.boost.org/trac10/ticket/13050
- print "Boost 1.64 has been detected. It is not recommended to use this version due to a regression within the library. Swift has been removed from the current build. You can still use this version by setting allow_boost_1_64 to true, but recent chats and highlighting rules will reset."
+ print("Boost 1.64 has been detected. It is not recommended to use this version due to a regression within the library. Swift has been removed from the current build. You can still use this version by setting allow_boost_1_64 to true, but recent chats and highlighting rules will reset.")
env["PROJECTS"].remove("Swift")