[Python-checkins] CVS: python/dist/src/Objects stringobject.c,2.93,2.94 unicodeobject.c,2.66,2.67
Tim Peters
python-dev@python.org
Wed, 29 Nov 2000 21:22:49 -0800
Update of /cvsroot/python/python/dist/src/Objects
In directory slayer.i.sourceforge.net:/tmp/cvs-serv4750/python/dist/src/Objects
Modified Files:
stringobject.c unicodeobject.c
Log Message:
Fox for SF bug #123859: %[duxXo] long formats inconsistent.
Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.93
retrieving revision 2.94
diff -C2 -r2.93 -r2.94
*** stringobject.c 2000/11/27 18:46:26 2.93
--- stringobject.c 2000/11/30 05:22:44 2.94
***************
*** 2898,2905 ****
if (c == 'i')
c = 'd';
! if (PyLong_Check(v) && PyLong_AsLong(v) == -1
! && PyErr_Occurred()) {
! /* Too big for a C long. */
! PyErr_Clear();
temp = _PyString_FormatLong(v, flags,
prec, c, &pbuf, &len);
--- 2898,2902 ----
if (c == 'i')
c = 'd';
! if (PyLong_Check(v)) {
temp = _PyString_FormatLong(v, flags,
prec, c, &pbuf, &len);
Index: unicodeobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v
retrieving revision 2.66
retrieving revision 2.67
diff -C2 -r2.66 -r2.67
*** unicodeobject.c 2000/10/03 20:45:26 2.66
--- unicodeobject.c 2000/11/30 05:22:44 2.67
***************
*** 5021,5027 ****
if (c == 'i')
c = 'd';
! if (PyLong_Check(v) && PyLong_AsLong(v) == -1
! && PyErr_Occurred()) {
! PyErr_Clear();
temp = formatlong(v, flags, prec, c);
if (!temp)
--- 5021,5025 ----
if (c == 'i')
c = 'd';
! if (PyLong_Check(v)) {
temp = formatlong(v, flags, prec, c);
if (!temp)