diff options
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ceval.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Python/ceval.c b/Python/ceval.c index 4aa3250..2b74d0e 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -5307,13 +5307,16 @@ import_all_from(PyObject *locals, PyObject *v) PyErr_Clear(); break; } - if (skip_leading_underscores && - PyUnicode_Check(name) && - PyUnicode_READY(name) != -1 && - PyUnicode_READ_CHAR(name, 0) == '_') - { - Py_DECREF(name); - continue; + if (skip_leading_underscores && PyUnicode_Check(name)) { + if (PyUnicode_READY(name) == -1) { + Py_DECREF(name); + err = -1; + break; + } + if (PyUnicode_READ_CHAR(name, 0) == '_') { + Py_DECREF(name); + continue; + } } value = PyObject_GetAttr(v, name); if (value == NULL) |