Skip to content

Commit f41bbf2

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

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

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)