From 6eef105e2592542746c56c02c64c5afa7050ee71 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sun, 21 Feb 2016 11:30:36 +0100 Subject: DOC: Use the same exception handling strategy in all examples --- examples/wire.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'examples/wire.py') diff --git a/examples/wire.py b/examples/wire.py index 6acdeb1..7ee4000 100755 --- a/examples/wire.py +++ b/examples/wire.py @@ -39,6 +39,7 @@ try: if callback_status: logging.warning(str(callback_status)) -except BaseException as e: - # This avoids printing the traceback, especially if Ctrl-C is used. - raise SystemExit(str(e)) +except KeyboardInterrupt: + parser.exit('\nInterrupted by user') +except Exception as e: + parser.exit(type(e).__name__ + ': ' + str(e)) -- cgit v1.2.3