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.
This commit is contained in:
Guido van Rossum 2007-02-09 23:20:19 +00:00
parent bdc36e4d9e
commit 79139b247b
19 changed files with 10 additions and 163 deletions

View file

@ -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
@ -1264,18 +1258,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. */
@ -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*/

View file

@ -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) {