From 79e08b836ab3c51f3a73a956e09daf01dec70d1e Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Mon, 11 Apr 2016 18:47:53 +0200 Subject: 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 --- sounddevice.py | 7 +++++-- 1 file 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: -- cgit v1.2.3