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

Unified Diff: git_squash_branch.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
Index: git_squash_branch.py
diff --git a/git_squash_branch.py b/git_squash_branch.py
index 0e02539356cd414180430498d96e68ce27d21752..1a91d2198bcf57d5cf434e0d5199284c63e93148 100755
--- a/git_squash_branch.py
+++ b/git_squash_branch.py
@@ -15,6 +15,12 @@ def main(args):
help='Use the given <msg> as the first line of the commit message.')
opts = parser.parse_args(args)
squash_current_branch(opts.message)
+ return 0
+
if __name__ == '__main__':
- sys.exit(main(sys.argv[1:]))
+ try:
+ sys.exit(main(sys.argv[1:]))
+ except KeyboardInterrupt:
+ print 'interrupted'
+ sys.exit(1)

Powered by Google App Engine
This is Rietveld 408576698