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

Benjamin Peterson webhook-mailer at python.org
Sun Jun 16 16:19:34 EDT 2019


https://github.com/python/cpython/commit/c83356cae2e375324ff4a3fb5d574ebde5c827a9
commit: c83356cae2e375324ff4a3fb5d574ebde5c827a9
branch: master
author: Hai Shi <shihai1992 at gmail.com>
committer: Benjamin Peterson <benjamin at python.org>
date: 2019-06-16T13:19:19-07:00
summary:

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

files:
A Misc/NEWS.d/next/Core and Builtins/2019-06-16-02-38-25.bpo-37300.WJkgKV.rst
M Objects/classobject.c

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 000000000000..aae278e84981
--- /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 2415ed14cb15..f26a85c62371 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);



More information about the Python-checkins mailing list