diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2014-06-11 18:41:32 +0300 |
---|---|---|
committer | Jukka Jylänki <jujjyl@gmail.com> | 2014-06-11 18:41:32 +0300 |
commit | 6515381c2c7f5ff5731c6e39a73ba4bcc2479224 (patch) | |
tree | 4d97b471f6835344e9faca1dd7231a0c5362a73e | |
parent | 801199434faea49d88e92bd1891985a98453d6c4 (diff) |
Improve Ctrl-C exception detection to cover the whole ffdb.py app.
-rwxr-xr-x | tools/ffdb.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/ffdb.py b/tools/ffdb.py index 9734014e..9ec643f5 100755 --- a/tools/ffdb.py +++ b/tools/ffdb.py @@ -66,9 +66,6 @@ def read_b2g_response(print_errors_to_console = True): try: if len(read_queue) == 0: read_queue += b2g_socket.recv(65536*2) - except KeyboardInterrupt: - print ' Aborted by user' - sys.exit(1) except Exception, e: if e[0] == 57: # Socket is not connected print 'Error! Failed to receive data from the device: socket is not connected!' @@ -659,6 +656,10 @@ def main(): return 0 if __name__ == '__main__': - returncode = main() - logv('ffdb.py quitting with process exit code ' + str(returncode)) - sys.exit(returncode) + try: + returncode = main() + logv('ffdb.py quitting with process exit code ' + str(returncode)) + sys.exit(returncode) + except KeyboardInterrupt: + print ' Aborted by user' + sys.exit(1) |