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

Unified Diff: git_freezer.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
« clang_format.py ('K') | « git_footers.py ('k') | git_map.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_freezer.py
diff --git a/git_freezer.py b/git_freezer.py
index 7a23be21fe05994fe8d2f7984ec4174610f14fc2..91a4ec0d94d6432331c438212b8982bd303f53b9 100755
--- a/git_freezer.py
+++ b/git_freezer.py
@@ -22,12 +22,17 @@ def CMDthaw(parser, args):
return thaw()
-def main():
+def main(args):
dispatcher = subcommand.CommandDispatcher(__name__)
- ret = dispatcher.execute(optparse.OptionParser(), sys.argv[1:])
+ ret = dispatcher.execute(optparse.OptionParser(), args)
if ret:
print ret
+ return 0
if __name__ == '__main__':
- main()
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« clang_format.py ('K') | « git_footers.py ('k') | git_map.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698