[PATCH] D59115: gn build: Unbreak get.py and gn.py on Windows

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 8 04:44:59 PST 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL355693: gn build: Unbreak get.py and gn.py on Windows (authored by nico, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D59115?vs=189792&id=189844#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59115/new/

https://reviews.llvm.org/D59115

Files:
  llvm/trunk/utils/gn/get.py
  llvm/trunk/utils/gn/gn.py


Index: llvm/trunk/utils/gn/gn.py
===================================================================
--- llvm/trunk/utils/gn/gn.py
+++ llvm/trunk/utils/gn/gn.py
@@ -16,7 +16,8 @@
 
 
 def get_platform():
-    if os.uname()[4] != 'x86_64':
+    import platform
+    if platform.machine() not in ('AMD64', 'x86_64'):
         return None
     if sys.platform.startswith('linux'):
         return 'linux-amd64'
@@ -46,7 +47,7 @@
         if not platform:
             return print_no_gn(mention_get=False)
         gn = os.path.join(os.path.dirname(__file__), 'bin', platform, 'gn')
-        if not os.path.exists(gn + ('.exe' if platform == 'windows' else '')):
+        if not os.path.exists(gn + ('.exe' if sys.platform == 'win32' else '')):
             return print_no_gn(mention_get=True)
 
     # Compute --dotfile= and --root= args to add.
Index: llvm/trunk/utils/gn/get.py
===================================================================
--- llvm/trunk/utils/gn/get.py
+++ llvm/trunk/utils/gn/get.py
@@ -33,7 +33,8 @@
 
 
 def get_platform():
-    if os.uname()[4] != 'x86_64':
+    import platform
+    if platform.machine() not in ('AMD64', 'x86_64'):
         return None
     if sys.platform.startswith('linux'):
         return 'linux-amd64'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59115.189844.patch
Type: text/x-patch
Size: 1256 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190308/7ed81f45/attachment.bin>


More information about the llvm-commits mailing list