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

Unified Diff: git_mark_merge_base.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_mark_merge_base.py
diff --git a/git_mark_merge_base.py b/git_mark_merge_base.py
index 673e2b433220c518959f7cf836612696243e3eab..214b3dfe468dfeacf6fb0fa4374dd884828100d8 100755
--- a/git_mark_merge_base.py
+++ b/git_mark_merge_base.py
@@ -39,7 +39,7 @@ def main(argv):
try:
remove_merge_base(cur)
except CalledProcessError:
- print "No merge base currently exists for %s." % cur
+ print 'No merge base currently exists for %s.' % cur
return 0
if opts.merge_base:
@@ -60,9 +60,12 @@ def main(argv):
print "Invalid merge_base %s" % opts.merge_base
print "merge_base(%s): %s" % (cur, actual)
-
return ret
if __name__ == '__main__':
- 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_map_branches.py ('k') | git_nav_downstream.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698