fix: catch OSError on sounddevice import for CI without PortAudio
sounddevice raises OSError (not ImportError) when the PortAudio C library is missing. This broke test collection on CI runners that have the Python package installed but lack the native library.
This commit is contained in:
@@ -61,7 +61,7 @@ except ImportError:
|
||||
try:
|
||||
import sounddevice as sd
|
||||
_HAS_AUDIO = True
|
||||
except ImportError:
|
||||
except (ImportError, OSError):
|
||||
sd = None # type: ignore[assignment]
|
||||
_HAS_AUDIO = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user