summaryrefslogtreecommitdiffstats
path: root/Tools/audiopy
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1999-09-22 15:45:51 (GMT)
committerBarry Warsaw <barry@python.org>1999-09-22 15:45:51 (GMT)
commitd8d179d69d46a07923ad07b70a2d5f5e57f8030a (patch)
tree7571e88e8d24f2c88a8d8ee4b4e8e9393abce4f2 /Tools/audiopy
parentda2d352bdb540cc07969a7321e3632d588e0e769 (diff)
downloadcpython-d8d179d69d46a07923ad07b70a2d5f5e57f8030a.zip
cpython-d8d179d69d46a07923ad07b70a2d5f5e57f8030a.tar.gz
cpython-d8d179d69d46a07923ad07b70a2d5f5e57f8030a.tar.bz2
main(): wrap the device.setinfo() call around an exception handler.
It's possible to get a sunaudiodev.error (errno == EINVAL), although I'm not exactly sure why, this at least won't crash the application.
Diffstat (limited to 'Tools/audiopy')
-rwxr-xr-xTools/audiopy/audiopy8
1 files changed, 7 insertions, 1 deletions
diff --git a/Tools/audiopy/audiopy b/Tools/audiopy/audiopy
index 19d69fd..ba03a69 100755
--- a/Tools/audiopy/audiopy
+++ b/Tools/audiopy/audiopy
@@ -48,6 +48,7 @@ Other options are:
import sys
import os
import string
+import errno
import sunaudiodev
from SUNAUDIODEV import *
@@ -490,7 +491,12 @@ Version: %s''' % __version__
else:
usage(1, msg='Invalid option: ' + arg)
# now set the values
- device.setinfo(info)
+ try:
+ device.setinfo(info)
+ except sunaudiodev.error, (code, msg):
+ if code == errno.EINVAL:
+ pass
+ raise
device.close()