]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41870: Avoid the test when nargs=0 (GH-22462)
authorDong-hee Na <donghee.na92@gmail.com>
Thu, 1 Oct 2020 04:50:40 +0000 (13:50 +0900)
committerGitHub <noreply@github.com>
Thu, 1 Oct 2020 04:50:40 +0000 (13:50 +0900)
Objects/boolobject.c

index ab7669cb240deb94af423a141847f1ce5f0f8b59..b786966533e1d6a320a4ec95f06f6f16c42ce941 100644 (file)
@@ -72,9 +72,9 @@ bool_vectorcall(PyObject *type, PyObject * const*args,
     assert(PyType_Check(type));
     if (nargs) {
         ok = PyObject_IsTrue(args[0]);
-    }
-    if (ok < 0) {
-        return NULL;
+        if (ok < 0) {
+            return NULL;
+        }
     }
     return PyBool_FromLong(ok);
 }