From: Guido van Rossum Date: Mon, 11 Mar 2002 00:07:13 +0000 (+0000) Subject: Bugfix candidate. X-Git-Tag: v2.3c1~6531 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15d529aec52276fe4df83aeda5b01e8df77344dc;p=python Bugfix candidate. Adapter from SF patch 528038; fixes SF bug 527816. The wrapper for __nonzero__ should be wrap_inquiry rather than wrap_unaryfunc, since the slot returns an int, not a PyObject *. --- diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index de9bba1636..696e99c927 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -426,6 +426,9 @@ def numops(a, b, skip=[]): def ints(): if verbose: print "Testing int operations..." numops(100, 3) + # The following crashes in Python 2.2 + vereq((1).__nonzero__(), 1) + vereq((0).__nonzero__(), 0) def longs(): if verbose: print "Testing long operations..."