Patch 1352 (continued in issue 1329) by Christian Heimes.

Before sys.stderr is set to the proper thing, set it to a really simple
file-like object that can print tracebacks using direct file descriptor I/O.
This is handy for debugging.
This commit is contained in:
Guido van Rossum 2007-10-30 18:34:07 +00:00
parent 1cd5bd2a2e
commit 826d8973ac
4 changed files with 136 additions and 1 deletions

View file

@ -21,6 +21,13 @@ PyAPI_FUNC(char *) Py_UniversalNewlineFgets(char *, int, FILE*, PyObject *);
*/
PyAPI_DATA(const char *) Py_FileSystemDefaultEncoding;
/* Internal API
The std printer acts as a preliminary sys.stderr until the new io
infrastructure is in place. */
PyAPI_FUNC(PyObject *) PyFile_NewStdPrinter(int);
PyAPI_DATA(PyTypeObject) PyStdPrinter_Type;
#ifdef __cplusplus
}
#endif