mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
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.
This commit is contained in:
parent
da2d352bdb
commit
d8d179d69d
1 changed files with 7 additions and 1 deletions
|
|
@ -48,6 +48,7 @@ Other options are:
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import string
|
import string
|
||||||
|
import errno
|
||||||
import sunaudiodev
|
import sunaudiodev
|
||||||
from SUNAUDIODEV import *
|
from SUNAUDIODEV import *
|
||||||
|
|
||||||
|
|
@ -490,7 +491,12 @@ Version: %s''' % __version__
|
||||||
else:
|
else:
|
||||||
usage(1, msg='Invalid option: ' + arg)
|
usage(1, msg='Invalid option: ' + arg)
|
||||||
# now set the values
|
# now set the values
|
||||||
device.setinfo(info)
|
try:
|
||||||
|
device.setinfo(info)
|
||||||
|
except sunaudiodev.error, (code, msg):
|
||||||
|
if code == errno.EINVAL:
|
||||||
|
pass
|
||||||
|
raise
|
||||||
device.close()
|
device.close()
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue