From: Hai Shi <shihai1992@gmail.com>
Date: Sun, 16 Jun 2019 20:19:19 +0000 (+0800)
Subject: closes bpo-37300: Remove unnecessary Py_XINCREF in classobject.c. (GH-14120)
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c83356cae2e375324ff4a3fb5d574ebde5c827a9;p=python

closes bpo-37300: Remove unnecessary Py_XINCREF in classobject.c. (GH-14120)
---

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 0000000000..aae278e849
--- /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 2415ed14cb..f26a85c623 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);