Commit 2a502d83 authored by Guido van Rossum's avatar Guido van Rossum

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).
parent d5405096
......@@ -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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment