diff Objects/typeobject.c @ 22230:fc4056b9cf18 2.2

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 *.
author Michael W. Hudson <mwh@python.net>
date Mon, 11 Mar 2002 10:19:48 +0000
parents cb5b4a54ff12
children f2eb95fb4529
line wrap: on
line diff
--- a/Objects/typeobject.c	Mon Mar 11 10:19:16 2002 +0000
+++ b/Objects/typeobject.c	Mon Mar 11 10:19:48 2002 +0000
@@ -3508,7 +3508,7 @@
 	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, "<<"),