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:
0xbyt4
2026-03-05 21:26:59 +03:00
parent 179d9e1a22
commit fd4f229eab

View File

@@ -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