diff options
author | Guido van Rossum <guido@python.org> | 2002-03-10 14:11:16 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-03-10 14:11:16 (GMT) |
commit | dfce3bf908f9f6e8b20d54ca5f724994f6790f8a (patch) | |
tree | 8b9847cc6c081fa72af60f7f5b59f1f4f295fa25 | |
parent | d674e17e961e0f466678106861627ce3d03840ca (diff) | |
download | cpython-dfce3bf908f9f6e8b20d54ca5f724994f6790f8a.zip cpython-dfce3bf908f9f6e8b20d54ca5f724994f6790f8a.tar.gz cpython-dfce3bf908f9f6e8b20d54ca5f724994f6790f8a.tar.bz2 |
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 *.
-rw-r--r-- | Objects/typeobject.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index df6d6f2..2ad1638 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3508,7 +3508,7 @@ static slotdef slotdefs[] = { UNSLOT("__pos__", nb_positive, slot_nb_positive, wrap_unaryfunc, "+x"), UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc, "abs(x)"), - UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_unaryfunc, + UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquiry, "x != 0"), UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"), BINSLOT("__lshift__", nb_lshift, slot_nb_lshift, "<<"), |