From: Guido van Rossum Date: Fri, 24 Jul 1998 19:53:54 +0000 (+0000) Subject: Use 'S' format character for the optional constructor argument, so we X-Git-Tag: v1.5.2a1~232 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a502d8304cdb92109a35ad32a3bfa4fe246d84f;p=python 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). --- diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c index 2d7c940c08..494d895d3d 100644 --- a/Modules/cStringIO.c +++ b/Modules/cStringIO.c @@ -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); }