Mailing List Archive

python/dist/src/Objects stringobject.c,2.192,2.193
Update of /cvsroot/python/python/dist/src/Objects
In directory usw-pr-cvs1:/tmp/cvs-serv13463

Modified Files:
stringobject.c
Log Message:
Undo this part of the previous checkin:

Also fixed an error message -- %s argument has non-string str()
doesn't make sense for %r, so the error message now differentiates
between %s and %r.

because PyObject_Repr() and PyObject_Str() ensure that this can never
happen. Added a helpful comment instead.


Index: stringobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v
retrieving revision 2.192
retrieving revision 2.193
diff -C2 -d -r2.192 -r2.193
*** stringobject.c 9 Oct 2002 19:07:53 -0000 2.192
--- stringobject.c 9 Oct 2002 19:14:30 -0000 2.193
***************
*** 3875,3882 ****
goto error;
if (!PyString_Check(temp)) {
PyErr_SetString(PyExc_TypeError,
! c == 's' ?
! "%s argument has non-string str()" :
! "%r argument has non-string repr()");
Py_DECREF(temp);
goto error;
--- 3875,3883 ----
goto error;
if (!PyString_Check(temp)) {
+ /* XXX Note: this should never happen,
+ since PyObject_Repr() and
+ PyObject_Str() assure this */
PyErr_SetString(PyExc_TypeError,
! "%s argument has non-string str()");
Py_DECREF(temp);
goto error;