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

Unified Diff: native_client_sdk/src/tools/create_nmf.py

Issue 16022005: [NaCl SDK] Add keyboard interrupt handlers for python scripts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
« no previous file with comments | « native_client_sdk/src/build_tools/test_sdk.py ('k') | native_client_sdk/src/tools/oshelpers.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/tools/create_nmf.py
diff --git a/native_client_sdk/src/tools/create_nmf.py b/native_client_sdk/src/tools/create_nmf.py
index 5c9d270d9956450ec146b2fd50ca4c0c65ebe692..6ca83abbf574c8e0d5e8014d695706965213b31b 100755
--- a/native_client_sdk/src/tools/create_nmf.py
+++ b/native_client_sdk/src/tools/create_nmf.py
@@ -635,6 +635,12 @@ def main(argv):
if len(args) < 1:
raise Error('No nexe files specified. See --help for more info')
+ for filename in args:
+ if not os.path.exists(filename):
+ raise Error('Input file not found: %s' % filename)
+ if not os.path.isfile(filename):
+ raise Error('Input is not a file: %s' % filename)
+
canonicalized = ParseExtraFiles(options.extra_files, sys.stderr)
if canonicalized is None:
parser.error('Bad --extra-files (-x) argument syntax')
@@ -684,4 +690,7 @@ if __name__ == '__main__':
except Error, e:
sys.stderr.write('%s: %s\n' % (os.path.basename(__file__), e))
rtn = 1
+ except KeyboardInterrupt:
+ sys.stderr.write('%s: interrupted\n' % os.path.basename(__file__))
+ rtn = 1
sys.exit(rtn)
« no previous file with comments | « native_client_sdk/src/build_tools/test_sdk.py ('k') | native_client_sdk/src/tools/oshelpers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698