From: Hirokazu Yamamoto Date: Sun, 12 Sep 2010 16:06:18 +0000 (+0000) Subject: Fixed refcount bug. I placed Py_INCREF in create_comerror() for compatibility X-Git-Tag: v3.2a3~305 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac;p=python Fixed refcount bug. I placed Py_INCREF in create_comerror() for compatibility with Python2.7. --- diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c index a6df55cad7..aaf46eac68 100644 --- a/Modules/_ctypes/_ctypes.c +++ b/Modules/_ctypes/_ctypes.c @@ -5120,6 +5120,7 @@ create_comerror(void) PyComError_Type.tp_base = (PyTypeObject*)PyExc_Exception; if (PyType_Ready(&PyComError_Type) < 0) return -1; + Py_INCREF(&PyComError_Type); ComError = (PyObject*)&PyComError_Type; return 0; }