[Python-checkins] Remove deadcode in _Py_inc_count() (GH-18257)

Victor Stinner webhook-mailer at python.org
Wed Jan 29 13:22:19 EST 2020


https://github.com/python/cpython/commit/5428f48b6308c7fd71636077f2ebc307c9a53d03
commit: 5428f48b6308c7fd71636077f2ebc307c9a53d03
branch: master
author: Victor Stinner <vstinner at python.org>
committer: GitHub <noreply at github.com>
date: 2020-01-29T19:22:11+01:00
summary:

Remove deadcode in _Py_inc_count() (GH-18257)

(tp->tp_next != NULL) check became redundant with
commit 45294a9562e5c360ee8ef8498d8792e05a6eb25e (merged in 2006).

files:
M Objects/object.c

diff --git a/Objects/object.c b/Objects/object.c
index 6fc114621c1d1..14533dba16d64 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -182,8 +182,6 @@ _Py_inc_count(PyTypeObject *tp)
 {
     if (tp->tp_next == NULL && tp->tp_prev == NULL) {
         /* first time; insert in linked list */
-        if (tp->tp_next != NULL) /* sanity check */
-            Py_FatalError("XXX _Py_inc_count sanity check");
         if (type_list)
             type_list->tp_prev = tp;
         tp->tp_next = type_list;



More information about the Python-checkins mailing list