]> granicus.if.org Git - python/commitdiff
dict could be NULL, so we need to XDECREF.
authorNeal Norwitz <nnorwitz@gmail.com>
Fri, 5 Oct 2007 03:39:17 +0000 (03:39 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Fri, 5 Oct 2007 03:39:17 +0000 (03:39 +0000)
Fix a compiler warning about passing a PyTypeObject* instead of PyObject*.

Modules/_collectionsmodule.c

index 33a77b6804403fb2aaeca89918a9334f82c1c429..78a71bf077e59929e5ae0bfaf0c3e0f660a1baf7 100644 (file)
@@ -614,7 +614,7 @@ deque_reduce(dequeobject *deque)
                PyErr_Clear();
        aslist = PySequence_List((PyObject *)deque);
        if (aslist == NULL) {
-               Py_DECREF(dict);
+               Py_XDECREF(dict);
                return NULL;
        }
        if (dict == NULL)
@@ -1143,7 +1143,7 @@ defdict_copy(defdictobject *dd)
           whose class constructor has the same signature.  Subclasses that
           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);
 }