From d8d179d69d46a07923ad07b70a2d5f5e57f8030a Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Wed, 22 Sep 1999 15:45:51 +0000 Subject: 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. --- Tools/audiopy/audiopy | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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() -- cgit v0.12