refactor(voice): close recorder stream under suppress(Exception)
Matches the stop() line above; still closes when stop() raises.
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user