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

Unified Diff: gclient.py

Issue 955993006: Handle KeyboardInterrupt consistently in python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: 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 | « gcl.py ('k') | git_auto_svn.py » ('j') | git_number.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index 5f9dac5c566e64f39de8d4b683809bbcab565e2a..85437ac86f5e42be182387abc9c5fb58ddf571dc 100755
--- a/gclient.py
+++ b/gclient.py
@@ -2266,7 +2266,7 @@ def disable_buffering():
sys.stdout = gclient_utils.MakeFileAnnotated(sys.stdout)
-def Main(argv):
+def main(argv):
"""Doesn't parse the arguments here, just find the right subcommand to
execute."""
if sys.hexversion < 0x02060000:
@@ -2292,9 +2292,14 @@ def Main(argv):
return 1
finally:
gclient_utils.PrintWarnings()
+ return 0
if '__main__' == __name__:
- sys.exit(Main(sys.argv[1:]))
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except KeyboardInterrupt:
+ print 'interrupted'
+ sys.exit(1)
# vim: ts=2:sw=2:tw=80:et:
« no previous file with comments | « gcl.py ('k') | git_auto_svn.py » ('j') | git_number.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698