summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-09-12 16:06:18 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-09-12 16:06:18 (GMT)
commit34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac (patch)
treea3519829248e626420317e0ef464218e7dbb8d3a
parent6464d5ffdc6ee54f023c6230f1633debf183815f (diff)
downloadcpython-34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac.zip
cpython-34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac.tar.gz
cpython-34aa30ca2b99cbc3157ca9ff7b1499860c7ab5ac.tar.bz2
Fixed refcount bug. I placed Py_INCREF in create_comerror() for compatibility
with Python2.7.
-rw-r--r--Modules/_ctypes/_ctypes.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index a6df55c..aaf46ea 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;
}