mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
ensure .keywords is always a dict
This commit is contained in:
parent
07abcf58d9
commit
65bcdd7195
3 changed files with 9 additions and 9 deletions
|
@ -54,17 +54,13 @@ partial_new(PyTypeObject *type, PyObject *args, PyObject *kw)
|
|||
Py_DECREF(pto);
|
||||
return NULL;
|
||||
}
|
||||
if (kw != NULL) {
|
||||
pto->kw = PyDict_Copy(kw);
|
||||
if (pto->kw == NULL) {
|
||||
Py_DECREF(pto);
|
||||
return NULL;
|
||||
}
|
||||
} else {
|
||||
pto->kw = Py_None;
|
||||
Py_INCREF(Py_None);
|
||||
pto->kw = (kw != NULL) ? PyDict_Copy(kw) : PyDict_New();
|
||||
if (pto->kw == NULL) {
|
||||
Py_DECREF(pto);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
pto->weakreflist = NULL;
|
||||
pto->dict = NULL;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue