mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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) {
|
IO_StringIO(PyObject *self, PyObject *args) {
|
||||||
PyObject *s=0;
|
PyObject *s=0;
|
||||||
|
|
||||||
UNLESS(PyArg_ParseTuple(args, "|O", &s)) return NULL;
|
UNLESS(PyArg_ParseTuple(args, "|S", &s)) return NULL;
|
||||||
if(s) return newIobject(s);
|
if(s) return newIobject(s);
|
||||||
return newOobject(128);
|
return newOobject(128);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue