mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue