diff options
author | SuperBo <supernbo@gmail.com> | 2017-05-14 14:38:21 +0700 |
---|---|---|
committer | SuperBo <supernbo@gmail.com> | 2017-05-14 14:38:21 +0700 |
commit | b290e05e9e9fa87bcc8c611582dc74c2decc5a10 (patch) | |
tree | 88c9f47cdca6ffff450c693dcd4291cac881a2d6 | |
parent | 6f2d5c474264b96caca3af16ab2a5ab34e7adab2 (diff) | |
download | numpy-b290e05e9e9fa87bcc8c611582dc74c2decc5a10.tar.gz |
BUG: Fix reference count error of types when init multiarraymodule
PyDict_SetItemString has internally increased object reference.
We don't need to INCREF before adding to module dict anymore.
-rw-r--r-- | numpy/core/src/multiarray/multiarraymodule.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c index 81a1bc543..cdc905b51 100644 --- a/numpy/core/src/multiarray/multiarraymodule.c +++ b/numpy/core/src/multiarray/multiarraymodule.c @@ -4666,23 +4666,15 @@ PyMODINIT_FUNC initmultiarray(void) { ADDCONST(MAY_SHARE_EXACT); #undef ADDCONST - Py_INCREF(&PyArray_Type); PyDict_SetItemString(d, "ndarray", (PyObject *)&PyArray_Type); - Py_INCREF(&PyArrayIter_Type); PyDict_SetItemString(d, "flatiter", (PyObject *)&PyArrayIter_Type); - Py_INCREF(&PyArrayMultiIter_Type); PyDict_SetItemString(d, "nditer", (PyObject *)&NpyIter_Type); - Py_INCREF(&NpyIter_Type); PyDict_SetItemString(d, "broadcast", (PyObject *)&PyArrayMultiIter_Type); - Py_INCREF(&PyArrayDescr_Type); PyDict_SetItemString(d, "dtype", (PyObject *)&PyArrayDescr_Type); - - Py_INCREF(&PyArrayFlags_Type); PyDict_SetItemString(d, "flagsobj", (PyObject *)&PyArrayFlags_Type); /* Business day calendar object */ - Py_INCREF(&NpyBusDayCalendar_Type); PyDict_SetItemString(d, "busdaycalendar", (PyObject *)&NpyBusDayCalendar_Type); set_flaginfo(d); |