Skip to content

Commit ae21f08

Browse files
authored
Document workaround for numpy lazy loading issue
Add comments to explain pre-importing numpy's lazy submodules to avoid CPython issue.
1 parent 9ba366a commit ae21f08

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/conftest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Pre-import numpy's lazy submodules in single-threaded context before
2+
# pytest-run-parallel forks workers. Works around CPython issue https://github.com/python/cpython/issues/149728
3+
# which causes numpy's lazy __getattr__ on rec/ma/linalg/fft/... to recurse
4+
# to RecursionError under concurrent first-touch from multiple threads.
5+
# Drop this file when CPython bugfix release happens.
6+
17
import numpy
28

39
for _attr in (

0 commit comments

Comments
 (0)