mirror of
https://github.com/python/cpython.git
synced 2025-11-01 14:11:41 +00:00
bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)
This commit is contained in:
parent
a180b007d9
commit
a24107b04c
31 changed files with 538 additions and 242 deletions
|
|
@ -54,11 +54,15 @@ PyFunction_NewWithQualName(PyObject *code, PyObject *globals, PyObject *qualname
|
|||
|
||||
/* __module__: If module name is in globals, use it.
|
||||
Otherwise, use None. */
|
||||
module = PyDict_GetItem(globals, __name__);
|
||||
module = PyDict_GetItemWithError(globals, __name__);
|
||||
if (module) {
|
||||
Py_INCREF(module);
|
||||
op->func_module = module;
|
||||
}
|
||||
else if (PyErr_Occurred()) {
|
||||
Py_DECREF(op);
|
||||
return NULL;
|
||||
}
|
||||
if (qualname)
|
||||
op->func_qualname = qualname;
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue