summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/ceval.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index b6ad444..9ad582b 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -5254,6 +5254,10 @@ import_from(PyObject *v, PyObject *name)
if (pkgname == NULL) {
goto error;
}
+ if (!PyUnicode_Check(pkgname)) {
+ Py_CLEAR(pkgname);
+ goto error;
+ }
fullmodname = PyUnicode_FromFormat("%U.%U", pkgname, name);
Py_DECREF(pkgname);
if (fullmodname == NULL) {