[Python-checkins] python/dist/src/Objects stringobject.c,2.171,2.172
nnorwitz@users.sourceforge.net
nnorwitz@users.sourceforge.net
Sun, 28 Jul 2002 08:19:49 -0700
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv21685/Objects
Modified Files:
stringobject.c
Log Message:
SF patch #577031, remove PyArg_Parse() since it's deprecated
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.171
retrieving revision 2.172
diff -C2 -d -r2.171 -r2.172
*** stringobject.c 28 Jul 2002 10:23:27 -0000 2.171
--- stringobject.c 28 Jul 2002 15:19:47 -0000 2.172
***************
*** 3121,3126 ****
char fmt[20];
double x;
! if (!PyArg_Parse(v, "d;float argument required", &x))
return -1;
if (prec < 0)
prec = 6;
--- 3121,3129 ----
char fmt[20];
double x;
! v = PyNumber_Float(v);
! if (!v)
return -1;
+ x = PyFloat_AS_DOUBLE(v);
+ Py_DECREF(v);
if (prec < 0)
prec = 6;
***************
*** 3297,3302 ****
long x;
! if (!PyArg_Parse(v, "l;int argument required", &x))
return -1;
if (prec < 0)
prec = 1;
--- 3300,3308 ----
long x;
! v = PyNumber_Int(v);
! if (!v)
return -1;
+ x = PyInt_AS_LONG(v);
+ Py_DECREF(v);
if (prec < 0)
prec = 1;