diff options
authorEdwin Mons <>2019-01-21 09:09:48 (GMT)
committerKevin Smith <>2019-01-21 16:51:15 (GMT)
commit9a27bc87984613a63cb6cfb651282b824df51c81 (patch)
tree4fc1c445bbc27cd7df2645270585105faca69c5e /Swiften/SConscript
parent54c71ab51b6c8d94492168e9cf6cf6045d7794f3 (diff)
Make compatible with both Py2 and Py3
The merge of 4.x changes onto master introduced changes to Pyhon scripts that weren't compatible with Python 3. The script is now compatible with both Python 2 and Python 3, and a slightly underimplemented test has been expanded to actually live up to its name. getGitBuildVersion has been refactored completely. It has been simplified to require only one invocation of git describe, unit tests for the parsing have been added, and a way to call getGitBuildVersion from the commandline has been added to (to avoid adding a unit test that would call out to an external tool). has been made compatible with Python3, and some additional logic to prevent emitting b'path/to/docbook/xml' instead of the desired 'path/to/docbook/xml' has been added. Generation of COPYING in Swift/QtUI now uses the upstream version provided with SCons 3, and our custom version has been removed. Unused code in the SwiftenDevelopersGuide SConscript with invalid regular expressions has been removed, and the remaining regular expressions in SConscripts have been fixed. Test-Information Code has been tested on macOS 10.14. Scons now completes a build on a clean tree using either Python 2 or Python 3. Running it on a previouly built tree works with either, as well, mixing versions between invocations is not an issue. Swift unit tests pass with Python 3.7.0. unit tests pass with Python 2.7.15 and 3.7.0. Running with doc=1 works with both Python 2 and Python 3, even if the docbook points to a path with unicode characters in it. Resulting COPYING file has been verified both visually and against a Python2 generated one on master. Resulting XML files for documentation have been inspected. Resulting manual HTML and PDF files have been inspected. Change-Id: I54de909d80b8e35a8c351261ae10ce3537729c84
Diffstat (limited to 'Swiften/SConscript')
1 files changed, 1 insertions, 1 deletions
diff --git a/Swiften/SConscript b/Swiften/SConscript
index 4deddaf..5705113 100644
--- a/Swiften/SConscript
+++ b/Swiften/SConscript
@@ -12,7 +12,7 @@ external_swiften_dep_modules = ["BOOST"]
if env["SCONS_STAGE"] == "flags" :
env["SWIFTEN_DLL"] = env["swiften_dll"]
env["SWIFTEN_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "swift")
- version_match = re.match("(\d+)\.(\d+).*", env["SWIFTEN_VERSION"])
+ version_match = re.match(r"(\d+)\.(\d+).*", env["SWIFTEN_VERSION"])
if version_match :