Skip to content

Commit c172d10

Browse files
author
Cheng Zhao
authored
fix: build failure with ninja and Python 3 on Windows (#113)
1 parent 45475a7 commit c172d10

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

pylib/gyp/generator/ninja.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2389,7 +2389,6 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, config_name
23892389
)
23902390
if flavor == "win":
23912391
master_ninja.variable("ld_host", ld_host)
2392-
master_ninja.variable("ldxx_host", ldxx_host)
23932392
else:
23942393
master_ninja.variable(
23952394
"ld_host", CommandWithWrapper("LINK", wrappers, ld_host)

pylib/gyp/msvs_emulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def _TargetConfig(self, config):
333333
# first level is globally for the configuration (this is what we consider
334334
# "the" config at the gyp level, which will be something like 'Debug' or
335335
# 'Release'), VS2015 and later only use this level
336-
if self.vs_version.short_name >= 2015:
336+
if int(self.vs_version.short_name) >= 2015:
337337
return config
338338
# and a second target-specific configuration, which is an
339339
# override for the global one. |config| is remapped here to take into
@@ -537,7 +537,7 @@ def GetCflags(self, config):
537537
)
538538
]
539539
)
540-
if self.vs_version.project_version >= 12.0:
540+
if float(self.vs_version.project_version) >= 12.0:
541541
# New flag introduced in VS2013 (project version 12.0) Forces writes to
542542
# the program database (PDB) to be serialized through MSPDBSRV.EXE.
543543
# https://msdn.microsoft.com/en-us/library/dn502518.aspx

pylib/gyp/win_tool.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ def ExecLinkWithManifests(
221221
# and sometimes doesn't unfortunately.
222222
with open(our_manifest) as our_f:
223223
with open(assert_manifest) as assert_f:
224-
our_data = our_f.read().translate(None, string.whitespace)
225-
assert_data = assert_f.read().translate(None, string.whitespace)
224+
translator = str.maketrans('', '', string.whitespace)
225+
our_data = our_f.read().translate(translator)
226+
assert_data = assert_f.read().translate(translator)
226227
if our_data != assert_data:
227228
os.unlink(out)
228229

0 commit comments

Comments
 (0)