mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
gh-123880: Allow recursive import of single-phase-init modules (GH-123950)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Brett Cannon <brett@python.org>
This commit is contained in:
parent
3e36e5aef1
commit
aee219f455
6 changed files with 141 additions and 25 deletions
13
Lib/test/test_import/data/circular_imports/singlephase.py
Normal file
13
Lib/test/test_import/data/circular_imports/singlephase.py
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
"""Circular import involving a single-phase-init extension.
|
||||
|
||||
This module is imported from the _testsinglephase_circular module from
|
||||
_testsinglephase, and imports that module again.
|
||||
"""
|
||||
|
||||
import importlib
|
||||
import _testsinglephase
|
||||
from test.test_import import import_extension_from_file
|
||||
|
||||
name = '_testsinglephase_circular'
|
||||
filename = _testsinglephase.__file__
|
||||
mod = import_extension_from_file(name, filename)
|
||||
Loading…
Add table
Add a link
Reference in a new issue