Skip to content

Commit

Permalink
Auto merge of #9624 - Jayflux:hotfix/9597, r=KiChjang
Browse files Browse the repository at this point in the history
use python's built in platform module for detection, for more accurac…

…y and cross platform support
Fixes #9597.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9624)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Feb 13, 2016
2 parents a164176 + 939f409 commit 80e55c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/servo/command_base.py
Expand Up @@ -13,6 +13,8 @@
import subprocess
from subprocess import PIPE
import sys
import platform

import toml

from mach.registrar import Registrar
Expand All @@ -32,7 +34,7 @@ def cd(new_path):


def host_triple():
os_type = subprocess.check_output(["uname", "-s"]).strip().lower()
os_type = platform.system().lower()
if os_type == "linux":
os_type = "unknown-linux-gnu"
elif os_type == "darwin":
Expand All @@ -44,7 +46,7 @@ def host_triple():
else:
os_type = "unknown"

cpu_type = subprocess.check_output(["uname", "-m"]).strip().lower()
cpu_type = platform.machine().lower()
if cpu_type in ["i386", "i486", "i686", "i768", "x86"]:
cpu_type = "i686"
elif cpu_type in ["x86_64", "x86-64", "x64", "amd64"]:
Expand Down

0 comments on commit 80e55c7

Please sign in to comment.