Skip to content

Commit 1feb292

Browse files
authored
brief the news
Fixes a race condition in importlib's module loading when using lazy submodules, preventing RecursionError in multi-threaded scenarios.
1 parent 19bc144 commit 1feb292

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
Fix a race in :mod:`importlib._bootstrap` where the fast path in
2-
``_find_and_load`` could return a module whose ``parent.child`` attribute had
3-
not yet been set. Under free-threaded CPython this caused packages using the
4-
lazy-submodule ``__getattr__`` pattern (e.g. NumPy) to recurse to
5-
:exc:`RecursionError` when multiple threads first-touched the same lazy
6-
submodule concurrently. ``spec._initializing`` is now kept ``True`` until
7-
after ``_find_and_load_unlocked`` has attached the module to its parent.
1+
fix race in importlib when importing module which defined getattr

0 commit comments

Comments
 (0)