diff options
| -rw-r--r-- | sounddevice.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sounddevice.py b/sounddevice.py index bf61a3e..6581faf 100644 --- a/sounddevice.py +++ b/sounddevice.py @@ -2515,8 +2515,11 @@ def _ignore_stderr(): FILE* stderr; /* GNU C library */ FILE* __stderrp; /* Mac OS X */ """) - stdio = ffi.dlopen(None) - devnull = stdio.fopen(_os.devnull.encode(), b'w') + try: + stdio = ffi.dlopen(None) + devnull = stdio.fopen(_os.devnull.encode(), b'w') + except OSError: + return try: stdio.stderr = devnull except KeyError: |
