Sitelet https://github.com/pythonthings/python-sounddevice/commit/f41bbf2fbf0fdd0bc3ad1ee90204c690b32e22e9
Skip to content

Commit f41bbf2

Browse files
committed
DOC: Only partly disable find_library()
1 parent ad5d651 commit f41bbf2

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎doc/fake__sounddevice.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,17 @@
44
import ctypes
55

66

7+
old_find_library = ctypes.util.find_library
8+
9+
10+
def new_find_library(name):
11+
if 'portaudio' in name.lower():
12+
return NotImplemented
13+
return old_find_library(name)
14+
15+
716
# Monkey-patch ctypes to disable searching for PortAudio
8-
ctypes.util.find_library = lambda _: NotImplemented
17+
ctypes.util.find_library = new_find_library
918

1019

1120
class ffi(object):

0 commit comments

Comments
 (0)