[Python-checkins] python/dist/src/Objects weakrefobject.c, 1.13.6.1, 1.13.6.2

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Feb 3 15:15:55 EST 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19970/Objects

Modified Files:
      Tag: release23-maint
	weakrefobject.c 
Log Message:
Fix bug in interpretation of the "callback" argument in the constructors for
weakref ref and proxy objects; None was not being treated as identical to
NULL, though it was documented as equivalent.


Index: weakrefobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v
retrieving revision 1.13.6.1
retrieving revision 1.13.6.2
diff -C2 -d -r1.13.6.1 -r1.13.6.2
*** weakrefobject.c	20 Nov 2003 22:13:51 -0000	1.13.6.1
--- weakrefobject.c	3 Feb 2004 20:15:31 -0000	1.13.6.2
***************
*** 625,629 ****
      list = GET_WEAKREFS_LISTPTR(ob);
      get_basic_refs(*list, &ref, &proxy);
!     if (callback == NULL || callback == Py_None)
          /* return existing weak reference if it exists */
          result = ref;
--- 625,631 ----
      list = GET_WEAKREFS_LISTPTR(ob);
      get_basic_refs(*list, &ref, &proxy);
!     if (callback == Py_None)
!         callback = NULL;
!     if (callback == NULL)
          /* return existing weak reference if it exists */
          result = ref;
***************
*** 665,668 ****
--- 667,672 ----
      list = GET_WEAKREFS_LISTPTR(ob);
      get_basic_refs(*list, &ref, &proxy);
+     if (callback == Py_None)
+         callback = NULL;
      if (callback == NULL)
          /* attempt to return an existing weak reference if it exists */




More information about the Python-checkins mailing list