Use 'S' format character for the optional constructor argument, so we

get a decent error message when it's not a string (instead of
confusing errors when trying to use the thing).
This commit is contained in:
Guido van Rossum 1998-07-24 19:53:54 +00:00
parent d540509682
commit 2a502d8304

View File

@ -565,7 +565,7 @@ static PyObject *
IO_StringIO(PyObject *self, PyObject *args) {
PyObject *s=0;
UNLESS(PyArg_ParseTuple(args, "|O", &s)) return NULL;
UNLESS(PyArg_ParseTuple(args, "|S", &s)) return NULL;
if(s) return newIobject(s);
return newOobject(128);
}