summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHai Shi <shihai1992@gmail.com>2019-06-16 20:19:19 (GMT)
committerBenjamin Peterson <benjamin@python.org>2019-06-16 20:19:19 (GMT)
commitc83356cae2e375324ff4a3fb5d574ebde5c827a9 (patch)
tree6c470958d38a21777b739d525987cd577d46c7d5
parent5600b5e1b24a3491e83f1b3038a7ea047a34c0bf (diff)
downloadcpython-c83356cae2e375324ff4a3fb5d574ebde5c827a9.zip
cpython-c83356cae2e375324ff4a3fb5d574ebde5c827a9.tar.gz
cpython-c83356cae2e375324ff4a3fb5d574ebde5c827a9.tar.bz2
closes bpo-37300: Remove unnecessary Py_XINCREF in classobject.c. (GH-14120)
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2019-06-16-02-38-25.bpo-37300.WJkgKV.rst1
-rw-r--r--Objects/classobject.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2019-06-16-02-38-25.bpo-37300.WJkgKV.rst b/Misc/NEWS.d/next/Core and Builtins/2019-06-16-02-38-25.bpo-37300.WJkgKV.rst
new file mode 100644
index 0000000..aae278e
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2019-06-16-02-38-25.bpo-37300.WJkgKV.rst
@@ -0,0 +1 @@
+Remove an unnecssary Py_XINCREF in classobject.c.
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 2415ed1..f26a85c 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -110,7 +110,7 @@ PyMethod_New(PyObject *func, PyObject *self)
im->im_weakreflist = NULL;
Py_INCREF(func);
im->im_func = func;
- Py_XINCREF(self);
+ Py_INCREF(self);
im->im_self = self;
im->vectorcall = method_vectorcall;
_PyObject_GC_TRACK(im);