Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
simplify the defdict_missing function
  • Loading branch information
Changaco committed Apr 22, 2026
commit 0985fd10099a7434359197927e03bbaae60e7cd6
6 changes: 1 addition & 5 deletions Modules/_collectionsmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2237,11 +2237,7 @@ defdict_missing(PyObject *op, PyObject *key)
PyObject *value;
if (factory == NULL || factory == Py_None) {
/* XXX Call dict.__missing__(key) */
PyObject *tup;
tup = PyTuple_Pack(1, key);
if (!tup) return NULL;
PyErr_SetObject(PyExc_KeyError, tup);
Py_DECREF(tup);
_PyErr_SetKeyError(key);
return NULL;
}
value = _PyObject_CallNoArgs(factory);
Expand Down