[Python-checkins] python/dist/src/Objects weakrefobject.c, 1.14, 1.15

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Feb 3 14:53:21 EST 2004


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

Modified Files:
	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.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** weakrefobject.c	20 Nov 2003 21:21:46 -0000	1.14
--- weakrefobject.c	3 Feb 2004 19:52:56 -0000	1.15
***************
*** 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