summaryrefslogtreecommitdiffstats
path: root/Python
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 /Python
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 'Python')
-rw-r--r--Python/ceval.c11
-rw-r--r--Python/pythonrun.c15
-rw-r--r--Python/sysmodule.c5
3 files changed, 1 insertions, 30 deletions
diff --git a/Python/ceval.c b/Python/ceval.c
index 7511bb6..0194687 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -3349,17 +3349,6 @@ PyEval_MergeCompilerFlags(PyCompilerFlags *cf)
return result;
}
-int
-Py_FlushLine(void)
-{
- PyObject *f = PySys_GetObject("stdout");
- if (f == NULL)
- return 0;
- if (!PyFile_SoftSpace(f, 0))
- return 0;
- return PyFile_WriteString("\n", f);
-}
-
/* External interface to call any callable object.
The arg must be a tuple or NULL. */
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 3aa1295..ec1bc42 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -795,8 +795,6 @@ PyRun_InteractiveOneFlags(FILE *fp, const char *filename, PyCompilerFlags *flags
return -1;
}
Py_DECREF(v);
- if (Py_FlushLine())
- PyErr_Clear();
return 0;
}
@@ -883,8 +881,6 @@ PyRun_SimpleFileExFlags(FILE *fp, const char *filename, int closeit,
return -1;
}
Py_DECREF(v);
- if (Py_FlushLine())
- PyErr_Clear();
return 0;
}
@@ -902,8 +898,6 @@ PyRun_SimpleStringFlags(const char *command, PyCompilerFlags *flags)
return -1;
}
Py_DECREF(v);
- if (Py_FlushLine())
- PyErr_Clear();
return 0;
}
@@ -1018,8 +1012,6 @@ handle_system_exit(void)
int exitcode = 0;
PyErr_Fetch(&exception, &value, &tb);
- if (Py_FlushLine())
- PyErr_Clear();
fflush(stdout);
if (value == NULL || value == Py_None)
goto done;
@@ -1097,8 +1089,6 @@ PyErr_PrintEx(int set_sys_last_vars)
v2 = Py_None;
Py_INCREF(v2);
}
- if (Py_FlushLine())
- PyErr_Clear();
fflush(stdout);
PySys_WriteStderr("Error in sys.excepthook:\n");
PyErr_Display(exception2, v2, tb2);
@@ -1128,8 +1118,6 @@ PyErr_Display(PyObject *exception, PyObject *value, PyObject *tb)
if (f == NULL)
fprintf(stderr, "lost sys.stderr\n");
else {
- if (Py_FlushLine())
- PyErr_Clear();
fflush(stdout);
if (tb && tb != Py_None)
err = PyTraceBack_Print(tb, f);
@@ -1597,8 +1585,6 @@ call_sys_exitfunc(void)
Py_DECREF(exitfunc);
}
- if (Py_FlushLine())
- PyErr_Clear();
}
static void
@@ -1855,4 +1841,3 @@ PyRun_InteractiveLoop(FILE *f, const char *p)
#ifdef __cplusplus
}
#endif
-
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 3f2d5b7..c7d85933 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -104,8 +104,6 @@ sys_displayhook(PyObject *self, PyObject *o)
}
if (PyObject_SetAttrString(builtins, "_", Py_None) != 0)
return NULL;
- if (Py_FlushLine() != 0)
- return NULL;
outf = PySys_GetObject("stdout");
if (outf == NULL) {
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
@@ -113,8 +111,7 @@ sys_displayhook(PyObject *self, PyObject *o)
}
if (PyFile_WriteObject(o, outf, 0) != 0)
return NULL;
- PyFile_SoftSpace(outf, 1);
- if (Py_FlushLine() != 0)
+ if (PyFile_WriteString("\n", outf) != 0)
return NULL;
if (PyObject_SetAttrString(builtins, "_", o) != 0)
return NULL;