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 *.
This commit is contained in:
Guido van Rossum 2002-03-10 14:11:16 +00:00
parent d674e17e96
commit dfce3bf908
1 changed files with 1 additions and 1 deletions

View File

@ -3508,7 +3508,7 @@ static slotdef slotdefs[] = {
UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+x"), UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+x"),
UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
"abs(x)"), "abs(x)"),
UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_unaryfunc, UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquiry,
"x != 0"), "x != 0"),
UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"),
BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"), BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"),