Skip to content

Commit 1cbf5b0

Browse files
committed
DOC: Only partly disable find_library()
Sphinx might import completely unrelated modules that might use find_library(), e.g. crypto.
1 parent 374c720 commit 1cbf5b0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

doc/fake__jack.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
"""Mock module for Sphinx autodoc."""
22

3-
43
import ctypes
54

5+
old_find_library = ctypes.util.find_library
6+
7+
8+
def new_find_library(name):
9+
if 'jack' in name.lower():
10+
return NotImplemented
11+
return old_find_library(name)
12+
613

714
# Monkey-patch ctypes to disable searching for JACK
8-
ctypes.util.find_library = lambda _: NotImplemented
15+
ctypes.util.find_library = new_find_library
916

1017

1118
class Fake(object):

0 commit comments

Comments
 (0)