diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2022-11-17 20:54:02 +0100 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2022-11-17 20:54:02 +0100 |
| commit | bcc7959bb3ea620fb4963a3f98990ff34cc67f59 (patch) | |
| tree | 8d24b386e6d882ecaa650ec737b9db3feddcdb76 /sounddevice.py | |
| parent | 397eac5ac43d1b0335dc1a377cfe1c4a8818cd5e (diff) | |
Use lower-level os.open() instead of open()
Diffstat (limited to 'sounddevice.py')
| -rw-r--r-- | sounddevice.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sounddevice.py b/sounddevice.py index 643d2fe..14653cd 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -2827,8 +2827,8 @@ def _initialize(): old_stderr = 2 # To appease Pyright try: old_stderr = _os.dup(2) - devnull = open(_os.devnull, 'w') - _os.dup2(devnull.fileno(), 2) + devnull = _os.open(_os.devnull, _os.O_WRONLY) + _os.dup2(devnull, 2) except OSError: pass try: @@ -2838,7 +2838,7 @@ def _initialize(): finally: if devnull is not None: _os.dup2(old_stderr, 2) - devnull.close() + _os.close(devnull) def _terminate(): |
