From 457a870d5fd2b99b519e69d9108177afb8b7972f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 27 Jun 2021 13:51:29 +0900 Subject: [PATCH 1/3] fix: translate() takes exactly 1 argument in python 3 --- pylib/gyp/win_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pylib/gyp/win_tool.py b/pylib/gyp/win_tool.py index 4dbcda50..638eee40 100755 --- a/pylib/gyp/win_tool.py +++ b/pylib/gyp/win_tool.py @@ -221,8 +221,9 @@ def ExecLinkWithManifests( # and sometimes doesn't unfortunately. with open(our_manifest) as our_f: with open(assert_manifest) as assert_f: - our_data = our_f.read().translate(None, string.whitespace) - assert_data = assert_f.read().translate(None, string.whitespace) + translator = str.maketrans('', '', string.whitespace) + our_data = our_f.read().translate(translator) + assert_data = assert_f.read().translate(translator) if our_data != assert_data: os.unlink(out) From 5067819879e667cfad29e91181f43888a2d315f3 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 27 Jun 2021 13:54:23 +0900 Subject: [PATCH 2/3] fix: float/int can not be compared to str in python 3 --- pylib/gyp/msvs_emulation.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pylib/gyp/msvs_emulation.py b/pylib/gyp/msvs_emulation.py index f744e38d..6fcabd04 100644 --- a/pylib/gyp/msvs_emulation.py +++ b/pylib/gyp/msvs_emulation.py @@ -333,7 +333,7 @@ def _TargetConfig(self, config): # first level is globally for the configuration (this is what we consider # "the" config at the gyp level, which will be something like 'Debug' or # 'Release'), VS2015 and later only use this level - if self.vs_version.short_name >= 2015: + if int(self.vs_version.short_name) >= 2015: return config # and a second target-specific configuration, which is an # override for the global one. |config| is remapped here to take into @@ -537,7 +537,7 @@ def GetCflags(self, config): ) ] ) - if self.vs_version.project_version >= 12.0: + if float(self.vs_version.project_version) >= 12.0: # New flag introduced in VS2013 (project version 12.0) Forces writes to # the program database (PDB) to be serialized through MSPDBSRV.EXE. # https://msdn.microsoft.com/en-us/library/dn502518.aspx From 6e024f20cbe1fc8b19dc56214f4b13059267a28a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 28 Jun 2021 11:05:30 +0900 Subject: [PATCH 3/3] fix: local variable 'ldxx_host' referenced before assignment --- pylib/gyp/generator/ninja.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py index 58162437..b66e674a 100644 --- a/pylib/gyp/generator/ninja.py +++ b/pylib/gyp/generator/ninja.py @@ -2389,7 +2389,6 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name ) if flavor == "win": master_ninja.variable("ld_host", ld_host) - master_ninja.variable("ldxx_host", ldxx_host) else: master_ninja.variable( "ld_host", CommandWithWrapper("LINK", wrappers, ld_host)