[Python-checkins] CVS: python/dist/src/Objects longobject.c,1.109,1.110
Tim Peters
tim_one@users.sourceforge.net
Sat, 29 Sep 2001 22:09:39 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv21648/python/Objects
Modified Files:
longobject.c
Log Message:
SF [#466125] PyLong_AsLongLong works for any integer.
Generalize PyLong_AsLongLong to accept int arguments too. The real point
is so that PyArg_ParseTuple's 'L' code does too. That code was
undocumented (AFAICT), so documented it.
Index: longobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -d -r1.109 -r1.110
*** longobject.c 2001/09/19 01:25:15 1.109
--- longobject.c 2001/09/30 05:09:37 1.110
***************
*** 680,684 ****
int res;
! if (vv == NULL || !PyLong_Check(vv)) {
PyErr_BadInternalCall();
return -1;
--- 680,690 ----
int res;
! if (vv == NULL) {
! PyErr_BadInternalCall();
! return -1;
! }
! if (!PyLong_Check(vv)) {
! if (PyInt_Check(vv))
! return (LONG_LONG)PyInt_AsLong(vv);
PyErr_BadInternalCall();
return -1;