summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/import.c b/Python/import.c
index f2b30af..50f4956 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -441,7 +441,9 @@ _PyImport_FixupExtensionObject(PyObject *mod, PyObject *name,
return -1;
}
- if (_Py_IsMainInterpreter(tstate->interp)) {
+ // bpo-44050: Extensions and def->m_base.m_copy can be updated
+ // when the extension module doesn't support sub-interpreters.
+ if (_Py_IsMainInterpreter(tstate->interp) || def->m_size == -1) {
if (def->m_size == -1) {
if (def->m_base.m_copy) {
/* Somebody already imported the module,