From 44df6dcec591d81aedfac7436ce84dcfec8693b2 Mon Sep 17 00:00:00 2001 From: Martin von Gagern Date: Tue, 31 Mar 2015 16:40:12 +0200 Subject: [PATCH] Fix some Python 3 problems with bytes versus string --- emsdk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emsdk b/emsdk index cf83e14..5fca9bf 100755 --- a/emsdk +++ b/emsdk @@ -313,7 +313,7 @@ def download_text_file(url, dstpath, download_even_if_exists=False): fix_lineendings(os.path.join(emsdk_path(), filename)) def run_get_output(cmd, cwd=None): - process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, env=os.environ.copy()) + process = subprocess.Popen(cmd, cwd=cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE, env=os.environ.copy(), universal_newlines=True) (stdout, stderr) = process.communicate() return (process.returncode, stdout, stderr) @@ -692,7 +692,7 @@ class Tool: def __init__(self, data): # Convert the dictionary representation of the tool in 'data' to members of this class for convenience. for key in data: - if isinstance(data[key], str): + if sys.version_info < (3,) and isinstance(data[key], str): setattr(self, key, data[key].encode('Latin-1')) else: setattr(self, key, data[key])