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

Unified Diff: git_rename_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
Index: git_rename_branch.py
diff --git a/git_rename_branch.py b/git_rename_branch.py
index cefa012ff614e5cf2626ea9f4b9a0f9ed381e6fd..c0ac42ec11cd50c8329061789e954c329909e169 100755
--- a/git_rename_branch.py
+++ b/git_rename_branch.py
@@ -44,7 +44,12 @@ def main(args):
except subprocess2.CalledProcessError as cpe:
sys.stderr.write(cpe.stderr)
return 1
+ 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_rebase_update.py ('k') | git_reparent_branch.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698