From d5511cbe29b952ee8311ad4b0a473cc2bc581b10 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Mon, 19 Dec 2016 17:32:28 +0100 Subject: Examples: Don't use the logging module, proper exit codes --- examples/play_file.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'examples/play_file.py') diff --git a/examples/play_file.py b/examples/play_file.py index d3fabb2..cf78815 100755 --- a/examples/play_file.py +++ b/examples/play_file.py @@ -10,7 +10,6 @@ To play very long files, you should use play_long_file.py instead. """ import argparse -import logging def int_or_str(text): @@ -33,7 +32,7 @@ try: sd.play(data, fs, device=args.device, blocking=True) status = sd.get_status() if status: - logging.warning(str(status)) + parser.exit('Error during playback: ' + str(status)) except KeyboardInterrupt: parser.exit('\nInterrupted by user') except Exception as e: -- cgit v1.2.3