summaryrefslogtreecommitdiffstats
path: root/Python/import.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/import.c')
-rw-r--r--Python/import.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 6544a84..b040c7d 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -3696,9 +3696,16 @@ _imp__override_multi_interp_extensions_check_impl(PyObject *module,
"cannot be used in the main interpreter");
return NULL;
}
+#ifdef Py_GIL_DISABLED
+ PyErr_SetString(PyExc_RuntimeError,
+ "_imp._override_multi_interp_extensions_check() "
+ "cannot be used in the free-threaded build");
+ return NULL;
+#else
int oldvalue = OVERRIDE_MULTI_INTERP_EXTENSIONS_CHECK(interp);
OVERRIDE_MULTI_INTERP_EXTENSIONS_CHECK(interp) = override;
return PyLong_FromLong(oldvalue);
+#endif
}
#ifdef HAVE_DYNAMIC_LOADING