File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -2823,22 +2823,22 @@ def _initialize():
2823
2823
is automatically called with the ``import sounddevice`` statement.
2824
2824
2825
2825
"""
2826
- devnull = None
2827
- old_stderr = 2 # To appease Pyright
2826
+ old_stderr = None
2828
2827
try :
2829
2828
old_stderr = _os .dup (2 )
2830
2829
devnull = _os .open (_os .devnull , _os .O_WRONLY )
2831
2830
_os .dup2 (devnull , 2 )
2831
+ _os .close (devnull )
2832
2832
except OSError :
2833
2833
pass
2834
2834
try :
2835
2835
_check (_lib .Pa_Initialize (), 'Error initializing PortAudio' )
2836
2836
global _initialized
2837
2837
_initialized += 1
2838
2838
finally :
2839
- if devnull is not None :
2839
+ if old_stderr is not None :
2840
2840
_os .dup2 (old_stderr , 2 )
2841
- _os .close (devnull )
2841
+ _os .close (old_stderr )
2842
2842
2843
2843
2844
2844
def _terminate ():
You can’t perform that action at this time.
0 commit comments