Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(871)

Unified Diff: native_client_sdk/src/tools/getos.py

Issue 10868089: add PRESUBMIT for native_client_sdk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | native_client_sdk/src/tools/oshelpers.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/getos.py
diff --git a/native_client_sdk/src/tools/getos.py b/native_client_sdk/src/tools/getos.py
index b16870d2d2109faa298f93053514306e3227ef70..8bfd2feae91cf71338683557f55b3b9640bd6d73 100755
--- a/native_client_sdk/src/tools/getos.py
+++ b/native_client_sdk/src/tools/getos.py
@@ -17,7 +17,7 @@ import subprocess
import sys
-TOOL_PATH=os.path.dirname(os.path.abspath(__file__))
+TOOL_PATH = os.path.dirname(os.path.abspath(__file__))
def ErrOut(text):
@@ -59,10 +59,10 @@ def GetSystemArch(platform):
if platform in ['mac', 'linux']:
try:
- pobj = subprocess.Popen(['uname', '-m'],stdout= subprocess.PIPE)
- arch, serr = pobj.communicate()
+ pobj = subprocess.Popen(['uname', '-m'], stdout= subprocess.PIPE)
+ arch = pobj.communicate()[0]
arch = arch.split()[0]
- except:
+ except Exception:
arch = None
return arch
@@ -82,13 +82,13 @@ def GetChromeArch(platform):
pobj = subprocess.Popen(['objdump', '-f', chrome_path],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
- arch, serr = pobj.communicate()
- format = re.compile(r'(file format) ([a-zA-Z0-9_\-]+)')
- arch = format.search(arch).group(2)
+ arch = pobj.communicate()[0]
+ file_format = re.compile(r'(file format) ([a-zA-Z0-9_\-]+)')
+ arch = file_format.search(arch).group(2)
if '64' in arch:
return 'x86_64'
return 'x86_32'
- except:
+ except Exception:
print "FAILED"
arch = None
return arch
« no previous file with comments | « native_client_sdk/src/tools/create_nmf.py ('k') | native_client_sdk/src/tools/oshelpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698