[Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.126.4.1,2.126.4.2

Michael Hudson mwh@users.sourceforge.net
Mon, 11 Mar 2002 02:19:50 -0800


Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv5500

Modified Files:
      Tag: release22-maint
	typeobject.c 
Log Message:
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 *.


Index: typeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v
retrieving revision 2.126.4.1
retrieving revision 2.126.4.2
diff -C2 -d -r2.126.4.1 -r2.126.4.2
*** typeobject.c	22 Feb 2002 13:31:18 -0000	2.126.4.1
--- typeobject.c	11 Mar 2002 10:19:48 -0000	2.126.4.2
***************
*** 3509,3513 ****
  	UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
  	       "abs(x)"),
! 	UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_unaryfunc,
  	       "x != 0"),
  	UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"),
--- 3509,3513 ----
  	UNSLOT("__abs__", nb_absolute, slot_nb_absolute, wrap_unaryfunc,
  	       "abs(x)"),
! 	UNSLOT("__nonzero__", nb_nonzero, slot_nb_nonzero, wrap_inquiry,
  	       "x != 0"),
  	UNSLOT("__invert__", nb_invert, slot_nb_invert, wrap_unaryfunc, "~x"),