diff options
| author | Matthias Geier <Matthias.Geier@gmail.com> | 2016-04-11 18:47:53 +0200 |
|---|---|---|
| committer | Matthias Geier <Matthias.Geier@gmail.com> | 2016-04-11 18:47:53 +0200 |
| commit | 79e08b836ab3c51f3a73a956e09daf01dec70d1e (patch) | |
| tree | 632a01daa08cb092bb9ffc336ae2fa695a9079d3 | |
| parent | 8fd670ee2a37a521f0d9f5529fed92dc0f4e4ced (diff) | |
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
| -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: |
