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

Unified Diff: pylint.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') | « presubmit_support.py ('k') | roll_dep.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylint.py
diff --git a/pylint.py b/pylint.py
index 9caa3a37110e19e8c0a435a2db78c3939513a310..f24ab1780192805d0fb9d416b251c2220159ff51 100755
--- a/pylint.py
+++ b/pylint.py
@@ -19,4 +19,8 @@ _RC_FILE = os.path.join(_HERE, 'pylintrc')
# another rcfile is to be used, passing --rcfile a second time on the command-
# line will work fine.
command = [sys.executable, _PYLINT, '--rcfile=%s' % _RC_FILE] + sys.argv[1:]
-sys.exit(subprocess.call(command))
+try:
+ sys.exit(subprocess.call(command))
+except KeyboardInterrupt:
+ sys.stderr.write('interrupted\n')
+ sys.exit(1)
« clang_format.py ('K') | « presubmit_support.py ('k') | roll_dep.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698