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

Unified Diff: git_new_branch.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_nav_downstream.py ('k') | git_number.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: git_new_branch.py
diff --git a/git_new_branch.py b/git_new_branch.py
index 18ce0180b7b24d123ecf78fef817c3eff54997e8..03b0fcc484bb1d3f6f693e734436ff3ee82e6ee9 100755
--- a/git_new_branch.py
+++ b/git_new_branch.py
@@ -48,7 +48,12 @@ def main(args):
sys.stderr.write(cpe.stderr)
return 1
sys.stderr.write('Switched to branch %s.\n' % opts.branch_name)
+ return 0
if __name__ == '__main__': # pragma: no cover
- sys.exit(main(sys.argv[1:]))
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« clang_format.py ('K') | « git_nav_downstream.py ('k') | git_number.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698