]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
fix *serious* (new) bug in testbool: by default objects should test
authorGuido van Rossum <guido@python.org>
Wed, 19 Aug 1992 16:41:45 +0000 (16:41 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 19 Aug 1992 16:41:45 +0000 (16:41 +0000)
true, not false!!!

Python/ceval.c

index 5b72d8eeb7e917dd0d7c7915011ed43b9ed0296e..72f5eb14cfa95b64f044f43b798f92ac0854933b 100644 (file)
@@ -1422,7 +1422,7 @@ testbool(v)
        else if (v->ob_type->tp_as_sequence != NULL)
                res = (*v->ob_type->tp_as_sequence->sq_length)(v);
        else
-               res = 0;
+               res = 1;
        if (res > 0)
                res = 1;
        return res;