summaryrefslogtreecommitdiffstats
path: root/Modules/cStringIO.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/cStringIO.c')
-rw-r--r--Modules/cStringIO.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c
index 09713e3..2d7c940 100644
--- a/Modules/cStringIO.c
+++ b/Modules/cStringIO.c
@@ -389,9 +389,12 @@ O_dealloc(Oobject *self) {
static PyObject *
O_getattr(Oobject *self, char *name) {
- if (strcmp(name, "softspace") == 0) {
+ if (name[0] == 's' && strcmp(name, "softspace") == 0) {
return PyInt_FromLong(self->softspace);
}
+ else if (name[0] == 'c' && strcmp(name, "closed") == 0) {
+ return PyInt_FromLong(self->closed);
+ }
return Py_FindMethod(O_methods, (PyObject *)self, name);
}
@@ -496,6 +499,9 @@ I_dealloc(Iobject *self) {
static PyObject *
I_getattr(Iobject *self, char *name) {
+ if (name[0] == 'c' && strcmp(name,"closed") == 0) {
+ return PyInt_FromLong(self->closed);
+ }
return Py_FindMethod(I_methods, (PyObject *)self, name);
}