diff Modules/cStringIO.c @ 8741:43464b1c880e legacy-trunk

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).
author Guido van Rossum <guido@python.org>
date Fri, 24 Jul 1998 19:53:54 +0000
parents 6170683e98e3
children 0f27257fb6cf
line wrap: on
line diff
--- a/Modules/cStringIO.c	Fri Jul 24 18:56:17 1998 +0000
+++ b/Modules/cStringIO.c	Fri Jul 24 19:53:54 1998 +0000
@@ -565,7 +565,7 @@
 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);
 }