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

Unified Diff: clang_format.py

Issue 955993006: Handle KeyboardInterrupt consistently in python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: tweek test expectations Created 5 years, 10 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 | « chrome-update.py ('k') | commit_queue.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: clang_format.py
diff --git a/clang_format.py b/clang_format.py
index 8320e6d2a0dc449d4e07cd82dcf3ab11b19c01c5..f69f94d6e7cdbc0e5ae6e8a7b669c6c7b5d5bca8 100755
--- a/clang_format.py
+++ b/clang_format.py
@@ -62,8 +62,12 @@ def main(args):
if any(match in args for match in help_syntax):
print '\nDepot tools redirects you to the clang-format at:\n %s\n' % tool
- return subprocess.call([tool] + sys.argv[1:])
+ return subprocess.call([tool] + args)
tfarina 2015/02/28 18:59:27 Looks like this broke my setup! Traceback (most r
if __name__ == '__main__':
- sys.exit(main(sys.argv))
+ try:
+ sys.exit(main(sys.argv[1]))
yosin_UTC9 2015/02/28 13:11:56 Q: Is using |argv[1]| rather than |argv[1:]| inten
+ except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« no previous file with comments | « chrome-update.py ('k') | commit_queue.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698