diff options
author | Guido van Rossum <guido@python.org> | 2002-10-09 19:14:30 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2002-10-09 19:14:30 (GMT) |
commit | 8052f8921e569c5c7c9afff6dc973dde9ec8f2e5 (patch) | |
tree | 333ceca266f31b399d7f89590c0248528df234df /Objects | |
parent | b00c07f038b3fdc567eaf7ae3d6f5006dd66a5dd (diff) | |
download | cpython-8052f8921e569c5c7c9afff6dc973dde9ec8f2e5.zip cpython-8052f8921e569c5c7c9afff6dc973dde9ec8f2e5.tar.gz cpython-8052f8921e569c5c7c9afff6dc973dde9ec8f2e5.tar.bz2 |
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.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/stringobject.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 52f96ff..6a9450a 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -3874,10 +3874,11 @@ PyString_Format(PyObject *format, PyObject *args) if (temp == NULL) goto error; if (!PyString_Check(temp)) { + /* XXX Note: this should never happen, + since PyObject_Repr() and + PyObject_Str() assure this */ PyErr_SetString(PyExc_TypeError, - c == 's' ? - "%s argument has non-string str()" : - "%r argument has non-string repr()"); + "%s argument has non-string str()"); Py_DECREF(temp); goto error; } |