Skip to content

Commit 79e08b8

Browse files
committed
Check for OSError on dlopen(None)
This no longer works on Windows, see http://cffi.readthedocs.org/en/latest/cdef.html#ffi-dlopen-loading-libraries-in-abi-mode
1 parent 8fd670e commit 79e08b8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sounddevice.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,8 +2515,11 @@ def _ignore_stderr():
25152515
FILE* stderr; /* GNU C library */
25162516
FILE* __stderrp; /* Mac OS X */
25172517
""")
2518-
stdio = ffi.dlopen(None)
2519-
devnull = stdio.fopen(_os.devnull.encode(), b'w')
2518+
try:
2519+
stdio = ffi.dlopen(None)
2520+
devnull = stdio.fopen(_os.devnull.encode(), b'w')
2521+
except OSError:
2522+
return
25202523
try:
25212524
stdio.stderr = devnull
25222525
except KeyError:

0 commit comments

Comments
 (0)