From fd4f229eab0fc76482fe39eb5340b258efa27a5f Mon Sep 17 00:00:00 2001 From: 0xbyt4 <35742124+0xbyt4@users.noreply.github.com> Date: Thu, 5 Mar 2026 21:26:59 +0300 Subject: [PATCH] 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. --- tools/tts_tool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tts_tool.py b/tools/tts_tool.py index 358bd6f1..31c57ce0 100644 --- a/tools/tts_tool.py +++ b/tools/tts_tool.py @@ -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