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:
parent
179d9e1a22
commit
fd4f229eab
1 changed files with 1 additions and 1 deletions
|
|
@ -61,7 +61,7 @@ except ImportError:
|
||||||
try:
|
try:
|
||||||
import sounddevice as sd
|
import sounddevice as sd
|
||||||
_HAS_AUDIO = True
|
_HAS_AUDIO = True
|
||||||
except ImportError:
|
except (ImportError, OSError):
|
||||||
sd = None # type: ignore[assignment]
|
sd = None # type: ignore[assignment]
|
||||||
_HAS_AUDIO = False
|
_HAS_AUDIO = False
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue