summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-09 23:20:19 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-09 23:20:19 (GMT)
commit79139b247b0bc0bc1b1a12932140bbd4bc188df7 (patch)
treefef7ef79dcb4e2a1ca033e725b1c2d802e9447d2 /Modules
parentbdc36e4d9e754dd00f17f67a943217a1829c75b3 (diff)
downloadcpython-79139b247b0bc0bc1b1a12932140bbd4bc188df7.zip
cpython-79139b247b0bc0bc1b1a12932140bbd4bc188df7.tar.gz
cpython-79139b247b0bc0bc1b1a12932140bbd4bc188df7.tar.bz2
Kill off softspace completely (except in formatter.py which seems to have
a different feature with the same name). The change to test_doctest.txt reduces the doctest failures to 3.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/bz2module.c20
-rw-r--r--Modules/cStringIO.c11
2 files changed, 2 insertions, 29 deletions
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 3c6daa9..9b39442 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -102,8 +102,6 @@ typedef struct {
char* f_bufend; /* Points after last occupied position */
char* f_bufptr; /* Current buffer position */
- int f_softspace; /* Flag used by 'print' command */
-
int f_univ_newline; /* Handle any newline convention */
int f_newlinetypes; /* Types of newlines seen */
int f_skipnextlf; /* Skip next \n */
@@ -813,8 +811,6 @@ BZ2File_write(BZ2FileObject *self, PyObject *args)
goto cleanup;
}
- self->f_softspace = 0;
-
Py_BEGIN_ALLOW_THREADS
BZ2_bzWrite (&bzerror, self->fp, buf, len);
self->pos += len;
@@ -934,8 +930,6 @@ BZ2File_writelines(BZ2FileObject *self, PyObject *seq)
}
}
- self->f_softspace = 0;
-
/* Since we are releasing the global lock, the
following code may *not* execute Python code. */
Py_BEGIN_ALLOW_THREADS
@@ -1265,18 +1259,6 @@ static PyGetSetDef BZ2File_getset[] = {
/* ===================================================================== */
-/* Members of BZ2File_Type. */
-
-#undef OFF
-#define OFF(x) offsetof(BZ2FileObject, x)
-
-static PyMemberDef BZ2File_members[] = {
- {"softspace", T_INT, OFF(f_softspace), 0,
- "flag indicating that a space needs to be printed; used by print"},
- {NULL} /* Sentinel */
-};
-
-/* ===================================================================== */
/* Slot definitions for BZ2File_Type. */
static int
@@ -1501,7 +1483,7 @@ static PyTypeObject BZ2File_Type = {
(getiterfunc)BZ2File_getiter, /*tp_iter*/
(iternextfunc)BZ2File_iternext, /*tp_iternext*/
BZ2File_methods, /*tp_methods*/
- BZ2File_members, /*tp_members*/
+ 0, /*tp_members*/
BZ2File_getset, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
diff --git a/Modules/cStringIO.c b/Modules/cStringIO.c
index 3f762b0..2ed1485 100644
--- a/Modules/cStringIO.c
+++ b/Modules/cStringIO.c
@@ -57,7 +57,6 @@ typedef struct { /* Subtype of IOobject */
Py_ssize_t pos, string_size;
Py_ssize_t buf_size;
- int softspace;
} Oobject;
/* Declarations for objects of type StringI */
@@ -489,13 +488,6 @@ static struct PyMethodDef O_methods[] = {
{NULL, NULL} /* sentinel */
};
-static PyMemberDef O_memberlist[] = {
- {"softspace", T_INT, offsetof(Oobject, softspace), 0,
- "flag indicating that a space needs to be printed; used by print"},
- /* getattr(f, "closed") is implemented without this table */
- {NULL} /* Sentinel */
-};
-
static void
O_dealloc(Oobject *self) {
if (self->buf != NULL)
@@ -536,7 +528,7 @@ static PyTypeObject Otype = {
PyObject_SelfIter, /*tp_iter */
(iternextfunc)IO_iternext, /*tp_iternext */
O_methods, /*tp_methods */
- O_memberlist, /*tp_members */
+ 0, /*tp_members */
file_getsetlist, /*tp_getset */
};
@@ -549,7 +541,6 @@ newOobject(int size) {
return NULL;
self->pos=0;
self->string_size = 0;
- self->softspace = 0;
self->buf = (char *)malloc(size);
if (!self->buf) {