]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
closes bpo-34504: Remove the useless NULL check in PySequence_Check(). (GH-8935)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 26 Aug 2018 00:14:37 +0000 (20:14 -0400)
committerGitHub <noreply@github.com>
Sun, 26 Aug 2018 00:14:37 +0000 (20:14 -0400)
Reported by Svace static analyzer.
(cherry picked from commit b57b4ac042b977e0b42a2f5ddb30ca7edffacfa9)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
Objects/abstract.c

index 6c6c86cd44a9bc2f550e0fbe8192e844193c9f30..252572024091c91417cbeab3d6928a3eb1809939 100644 (file)
@@ -1477,7 +1477,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;
 }