about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJonathan Turner <jonathandturner@users.noreply.github.com>2016-09-16 09:29:49 -0700
committerGitHub <noreply@github.com>2016-09-16 09:29:49 -0700
commitc6f1db6f6072fefec1249fe2339d6f44ae8e4371 (patch)
tree9ed6de81f8daaa8e925e47f932382e3165ced959 /src
parent390e8bd15d4a0adfaf5799a7a382bd55411864d4 (diff)
parent3f7931017463459768e4281f6f4cea1d75e2e1fe (diff)
downloadrust-c6f1db6f6072fefec1249fe2339d6f44ae8e4371.tar.gz
rust-c6f1db6f6072fefec1249fe2339d6f44ae8e4371.zip
Rollup merge of #36509 - nagisa:rustbuild-py3, r=alexcrichton
Try to support py3 with rustbuild better

Annoying to have it fail when you run with `python` only to have to rerun later with `python2`.

r? @alexcrichton
Diffstat (limited to 'src')
-rw-r--r--src/bootstrap/bootstrap.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 17a7c9ca66a..14a985e93ce 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -269,6 +269,7 @@ class RustBuild:
             sys.exit(ret)
 
     def build_triple(self):
+        default_encoding = sys.getdefaultencoding()
         config = self.get_toml('build')
         if config:
             return config
@@ -276,8 +277,8 @@ class RustBuild:
         if config:
             return config
         try:
-            ostype = subprocess.check_output(['uname', '-s']).strip()
-            cputype = subprocess.check_output(['uname', '-m']).strip()
+            ostype = subprocess.check_output(['uname', '-s']).strip().decode(default_encoding)
+            cputype = subprocess.check_output(['uname', '-m']).strip().decode(default_encoding)
         except (subprocess.CalledProcessError, WindowsError):
             if sys.platform == 'win32':
                 return 'x86_64-pc-windows-msvc'
@@ -289,7 +290,8 @@ class RustBuild:
         # Darwin's `uname -s` lies and always returns i386. We have to use
         # sysctl instead.
         if ostype == 'Darwin' and cputype == 'i686':
-            sysctl = subprocess.check_output(['sysctl', 'hw.optional.x86_64'])
+            args = ['sysctl', 'hw.optional.x86_64']
+            sysctl = subprocess.check_output(args).decode(default_encoding)
             if ': 1' in sysctl:
                 cputype = 'x86_64'