]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
backport gvanrossum's checkin of
authorMichael W. Hudson <mwh@python.net>
Mon, 11 Mar 2002 10:20:04 +0000 (10:20 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 11 Mar 2002 10:20:04 +0000 (10:20 +0000)
    revision 1.117 of test_descr.py

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 *.

Lib/test/test_descr.py

index de9bba163660a0d4890a268bd4d2d54493ce9bd0..696e99c92790571e65bb52dab4eeb5a4b3d5b65f 100644 (file)
@@ -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..."