[Python-checkins] CVS: python/dist/src/Modules _weakref.c,1.14,1.15

Fred L. Drake fdrake@users.sourceforge.net
Tue, 23 Oct 2001 14:12:49 -0700


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

Modified Files:
	_weakref.c 
Log Message:
Convert the ref() and proxy() implementations to use the new
PyArg_UnpackTuple() function (serves as an example and test case).


Index: _weakref.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_weakref.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** _weakref.c	2001/10/05 22:00:24	1.14
--- _weakref.c	2001/10/23 21:12:47	1.15
***************
*** 70,74 ****
      PyObject *result = NULL;
  
!     if (PyArg_ParseTuple(args, "O|O:ref", &object, &callback)) {
          result = PyWeakref_NewRef(object, callback);
      }
--- 70,74 ----
      PyObject *result = NULL;
  
!     if (PyArg_UnpackTuple(args, "ref", 1, 2, &object, &callback)) {
          result = PyWeakref_NewRef(object, callback);
      }
***************
*** 89,93 ****
      PyObject *result = NULL;
  
!     if (PyArg_ParseTuple(args, "O|O:new", &object, &callback)) {
          result = PyWeakref_NewProxy(object, callback);
      }
--- 89,93 ----
      PyObject *result = NULL;
  
!     if (PyArg_UnpackTuple(args, "proxy", 1, 2, &object, &callback)) {
          result = PyWeakref_NewProxy(object, callback);
      }