Skip to content

The agent that grows with you

refactor(voice): close recorder stream under suppress(Exception)

kshitijk4poor72942bfcaef1
diff --git a/tools/voice_mode.py b/tools/voice_mode.py
index 691ab00edf0..5cba4bf4739 100644
--- a/tools/voice_mode.py
+++ b/tools/voice_mode.py
@@ -815,10 +815,8 @@ class AudioRecorder(_RecorderBase):
def _do_close():
with suppress(Exception):
stream.stop()
- try:
+ with suppress(Exception):
stream.close()
- except Exception:
- pass
t = threading.Thread(target=_do_close, daemon=True)
t.start()