summaryrefslogtreecommitdiff
path: root/examples/play_file.py
diff options
context:
space:
mode:
authorMatthias Geier <Matthias.Geier@gmail.com>2016-12-19 17:32:28 +0100
committerMatthias Geier <Matthias.Geier@gmail.com>2016-12-19 17:33:12 +0100
commitd5511cbe29b952ee8311ad4b0a473cc2bc581b10 (patch)
tree07605bc574932967f2fa09cec1e88f765f3b2cdd /examples/play_file.py
parentb728182025874ba4293a7a4405fd61a3fdaa4da2 (diff)
Examples: Don't use the logging module, proper exit codes
Diffstat (limited to 'examples/play_file.py')
-rwxr-xr-xexamples/play_file.py3
1 files changed, 1 insertions, 2 deletions
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: