Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15d529a

Browse files
committed
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 *.
1 parent a2168ec commit 15d529a

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Lib/test/test_descr.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ def numops(a, b, skip=[]):
426426
def ints():
427427
if verbose: print "Testing int operations..."
428428
numops(100, 3)
429+
# The following crashes in Python 2.2
430+
vereq((1).__nonzero__(), 1)
431+
vereq((0).__nonzero__(), 0)
429432

430433
def longs():
431434
if verbose: print "Testing long operations..."

0 commit comments

Comments
 (0)