aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/importdl.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/importdl.c')
-rw-r--r--Python/importdl.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c
index 6dafb454148..3a3a30ddbdc 100644
--- a/Python/importdl.c
+++ b/Python/importdl.c
@@ -3,6 +3,7 @@
#include "Python.h"
#include "pycore_call.h"
+#include "pycore_import.h"
#include "pycore_pystate.h"
#include "pycore_runtime.h"
@@ -203,6 +204,10 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp)
/* Fall back to single-phase init mechanism */
+ if (_PyImport_CheckSubinterpIncompatibleExtensionAllowed(name_buf) < 0) {
+ goto error;
+ }
+
if (hook_prefix == nonascii_prefix) {
/* don't allow legacy init for non-ASCII module names */
PyErr_Format(