mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
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:
parent
d540509682
commit
2a502d8304
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user