[Python-checkins] CVS: python/dist/src/Objects descrobject.c,2.5,2.6
Guido van Rossum
gvanrossum@users.sourceforge.net
2001年8月24日 03:17:38 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv31393
Modified Files:
descrobject.c
Log Message:
getset_descr_set(): guard against deletion (indicated by a set call
with a NULL value), in a somewhat lame way: call the set() function
with one argument. Should I add a 3rd function, 'del', instead?
Index: descrobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/descrobject.c,v
retrieving revision 2.5
retrieving revision 2.6
diff -C2 -d -r2.5 -r2.6
*** descrobject.c 2001年08月24日 09:55:51 2.5
--- descrobject.c 2001年08月24日 10:17:36 2.6
***************
*** 907,911 ****
return -1;
}
! res = PyObject_CallFunction(gs->set, "(OO)", obj, value);
if (res == NULL)
return -1;
--- 907,914 ----
return -1;
}
! if (value == NULL)
! res = PyObject_CallFunction(gs->set, "(O)", obj);
! else
! res = PyObject_CallFunction(gs->set, "(OO)", obj, value);
if (res == NULL)
return -1;