diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/importdl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/importdl.c b/Python/importdl.c index 32fb7e1..50231ff 100644 --- a/Python/importdl.c +++ b/Python/importdl.c @@ -103,6 +103,11 @@ _PyImport_LoadDynamicModuleWithSpec(PyObject *spec, FILE *fp) if (name_unicode == NULL) { return NULL; } + if (!PyUnicode_Check(name_unicode)) { + PyErr_SetString(PyExc_TypeError, + "spec.name must be a string"); + goto error; + } name = get_encoded_name(name_unicode, &hook_prefix); if (name == NULL) { |