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():
28232823 is automatically called with the ``import sounddevice`` statement.
28242824
28252825 """
2826- devnull = None
2827- old_stderr = 2 # To appease Pyright
2826+ old_stderr = None
28282827 try :
28292828 old_stderr = _os .dup (2 )
28302829 devnull = _os .open (_os .devnull , _os .O_WRONLY )
28312830 _os .dup2 (devnull , 2 )
2831+ _os .close (devnull )
28322832 except OSError :
28332833 pass
28342834 try :
28352835 _check (_lib .Pa_Initialize (), 'Error initializing PortAudio' )
28362836 global _initialized
28372837 _initialized += 1
28382838 finally :
2839- if devnull is not None :
2839+ if old_stderr is not None :
28402840 _os .dup2 (old_stderr , 2 )
2841- _os .close (devnull )
2841+ _os .close (old_stderr )
28422842
28432843
28442844def _terminate ():
You can’t perform that action at this time.
0 commit comments