From: Michael W. Hudson Date: Mon, 11 Mar 2002 10:19:48 +0000 (+0000) Subject: backport gvanrossum's checkin of X-Git-Tag: v2.2.1c1~76 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=095fbeb55b63d83e8975ec675605709c1ec8d73e;p=thirdparty%2FPython%2Fcpython.git backport gvanrossum's checkin of revision 2.128 of typeobject.c 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/Objects/typeobject.c b/Objects/typeobject.c index df6d6f291d03..2ad1638a29dc 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, "<<"),