diff options
| author | Eric Snow <ericsnowcurrently@gmail.com> | 2023-04-04 23:03:40 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-04 23:03:40 (GMT) |
| commit | f513d5c80672c76acbdaf7d5b601f4bbe9fae56a (patch) | |
| tree | 2e62703bea7ceb964c1de11eaa14a1383b23aed8 /Python/pylifecycle.c | |
| parent | bceb9e00ad2998e5193ad5b477e92a114dd31024 (diff) | |
| download | cpython-f513d5c80672c76acbdaf7d5b601f4bbe9fae56a.zip cpython-f513d5c80672c76acbdaf7d5b601f4bbe9fae56a.tar.gz cpython-f513d5c80672c76acbdaf7d5b601f4bbe9fae56a.tar.bz2 | |
gh-102660: Fix is_core_module() (gh-103257)
In gh-102744 we added is_core_module() (in Python/import.c), which relies on get_core_module_dict() (also added in that PR). The problem is that_PyImport_FixupBuiltin(), which ultimately calls is_core_module(), is called on the builtins module before interp->builtins_copyis set. Consequently, the builtins module isn't considered a "core" module while it is getting "fixed up" and its module def m_copy erroneously gets set. Under isolated interpreters this causes problems since sys and builtins are allowed even though they are still single-phase init modules. (This was discovered while working on gh-101660.)
The solution is to stop relying on get_core_module_dict() in is_core_module().
Diffstat (limited to 'Python/pylifecycle.c')
0 files changed, 0 insertions, 0 deletions
