Skip to content

Commit

Permalink
Misc python3 fixes in xcode_emulation.
Browse files Browse the repository at this point in the history
BUG=gyp:36

Change-Id: I740beedd6bf8fca2d8db03ee57e762201b5d1df4
Reviewed-on: https://chromium-review.googlesource.com/c/external/gyp/+/1633670
Reviewed-by: Mark Mentovai <[email protected]>
  • Loading branch information
dpranke committed May 29, 2019
1 parent 5c270f7 commit da63cb0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylib/gyp/xcode_emulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ def _XcodeSdkPath(self, sdk_root):
XcodeSettings._sdk_path_cache[sdk_root] = sdk_path
if sdk_root:
XcodeSettings._sdk_root_cache[sdk_path] = sdk_root
return XcodeSettings._sdk_path_cache[sdk_root]
return XcodeSettings._sdk_path_cache[sdk_root].decode()

def _AppendPlatformVersionMinFlags(self, lst):
self._Appendf(lst, 'MACOSX_DEPLOYMENT_TARGET', '-mmacosx-version-min=%s')
Expand Down Expand Up @@ -1413,7 +1413,7 @@ def XcodeVersion():
version = version_list[0]
build = version_list[-1]
# Be careful to convert "4.2" to "0420":
version = version.split()[-1].replace('.', '')
version = version.split()[-1].decode().replace('.', '')
version = (version + '0' * (3 - len(version))).zfill(4)
if build:
build = build.split()[-1]
Expand Down Expand Up @@ -1450,7 +1450,7 @@ def GetStdout(cmdlist):
job = subprocess.Popen(cmdlist, stdout=subprocess.PIPE)
out = job.communicate()[0]
if job.returncode != 0:
sys.stderr.write(out + '\n')
sys.stderr.write(out + b'\n')
raise GypError('Error %d running %s' % (job.returncode, cmdlist[0]))
return out.rstrip('\n')

Expand Down

0 comments on commit da63cb0

Please sign in to comment.