Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Python/import.c
Original file line number Diff line number Diff line change
Expand Up @@ -1021,6 +1021,13 @@ _imp_create_builtin(PyObject *module, PyObject *spec)
return NULL;
}

if (!PyUnicode_Check(name)) {
PyErr_Format(PyExc_TypeError,
"name must be string, not %.200s",
Py_TYPE(name)->tp_name);
return NULL;
}

PyObject *mod = create_builtin(tstate, name, spec);
Py_DECREF(name);
return mod;
Expand Down