From d6725fcdd54cb3c72201eaa8841dd72d84f5f71d Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Sat, 25 Aug 2018 20:03:48 -0400 Subject: [PATCH] closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935) Reported by Svace static analyzer. (cherry picked from commit b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9) Co-authored-by: Alexey Izbyshev --- Objects/abstract.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/abstract.c b/Objects/abstract.c index 93eda62a274..2d48a112aab 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -1501,7 +1501,7 @@ PySequence_Check(PyObject *s) { if (PyDict_Check(s)) return 0; - return s != NULL && s->ob_type->tp_as_sequence && + return s->ob_type->tp_as_sequence && s->ob_type->tp_as_sequence->sq_item != NULL; }