Kaydet (Commit) c47cf7de authored tarafından Neal Norwitz's avatar Neal Norwitz

dict could be NULL, so we need to XDECREF.

Fix a compiler warning about passing a PyTypeObject* instead of PyObject*.
üst 06f8067a
...@@ -614,7 +614,7 @@ deque_reduce(dequeobject *deque) ...@@ -614,7 +614,7 @@ deque_reduce(dequeobject *deque)
PyErr_Clear(); PyErr_Clear();
aslist = PySequence_List((PyObject *)deque); aslist = PySequence_List((PyObject *)deque);
if (aslist == NULL) { if (aslist == NULL) {
Py_DECREF(dict); Py_XDECREF(dict);
return NULL; return NULL;
} }
if (dict == NULL) if (dict == NULL)
...@@ -1143,7 +1143,7 @@ defdict_copy(defdictobject *dd) ...@@ -1143,7 +1143,7 @@ defdict_copy(defdictobject *dd)
whose class constructor has the same signature. Subclasses that whose class constructor has the same signature. Subclasses that
define a different constructor signature must override copy(). define a different constructor signature must override copy().
*/ */
return PyObject_CallFunctionObjArgs(Py_Type(dd), return PyObject_CallFunctionObjArgs((PyObject*)Py_Type(dd),
dd->default_factory, dd, NULL); dd->default_factory, dd, NULL);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment