Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: third_party/libadblockplus_common/subproc.py

Issue 29674555: Issue 6273 - Apply eyeo python code style (Closed)
Patch Set: Removed sys.exit() where return code is always 0 Created Jan. 29, 2018, 12:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/libadblockplus_common/delete_dir.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/libadblockplus_common/subproc.py
diff --git a/third_party/libadblockplus_common/subproc.py b/third_party/libadblockplus_common/subproc.py
index 3df27e032f9b2d1ea11792bc51c0b5f7fd5318a1..1b08289806a532a21146de20c33d98fb3bf9eb7f 100644
--- a/third_party/libadblockplus_common/subproc.py
+++ b/third_party/libadblockplus_common/subproc.py
@@ -1,3 +1,5 @@
+from __future__ import print_function
+
import os
import sys
import subprocess
@@ -9,7 +11,7 @@ def main(argv):
subprocess_args = []
for arg in argv:
# if it's env var
- if arg[: 5] == '--env':
+ if arg[:5] == '--env':
equal_pos = arg.index('=')
key = arg[5:equal_pos]
value = arg[equal_pos + 1:len(arg)]
@@ -17,7 +19,7 @@ def main(argv):
subprocess_env[key] = value
else:
# if it's cwd
- if arg[: 5] == '--cwd':
+ if arg[:5] == '--cwd':
cwd = arg[5:]
print('Set cwd={}'.format(cwd))
else:
@@ -30,9 +32,8 @@ def main(argv):
return process.returncode
-if '__main__' == __name__:
+if __name__ == '__main__':
try:
sys.exit(main(sys.argv[1:]))
except KeyboardInterrupt:
- sys.stderr.write('interrupted\n')
- sys.exit(1)
+ sys.exit('interrupted')
« no previous file with comments | « third_party/libadblockplus_common/delete_dir.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld