Skip to content

Commit

Permalink
return null
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Dec 4, 2023
1 parent a1c7198 commit 3bac475
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Objects/moduleobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,11 @@ _Py_module_getattro_impl(PyModuleObject *m, PyObject *name, int suppress)
if (suppress != 1) {
if (_PyModuleSpec_IsInitializing(spec)) {
int valid_spec = PyObject_GetOptionalAttr(spec, &_Py_ID(origin), &origin);
// check if origin is a str object
if (valid_spec == -1) {
Py_XDECREF(spec);
Py_DECREF(mod_name);
return NULL;
}
if (valid_spec == 1 && !PyUnicode_Check(origin)) {
valid_spec = 0;
Py_DECREF(origin);
Expand Down

0 comments on commit 3bac475

Please sign in to comment.