diff options
Diffstat (limited to 'examples/play_file.py')
| -rwxr-xr-x | examples/play_file.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/play_file.py b/examples/play_file.py index cbbe828..402d814 100755 --- a/examples/play_file.py +++ b/examples/play_file.py @@ -20,6 +20,7 @@ try: status = sd.get_status() if status: logging.warning(str(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)) |
