diff options
author | Guido van Rossum <guido@python.org> | 2007-07-11 09:28:11 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-07-11 09:28:11 +0000 |
commit | 60783202b8e51b6230d8001bf4ab2fd9e46adf73 (patch) | |
tree | ca5d44b70a251c4d83da0be06a50af4ff629aafe /Objects/fileobject.c | |
parent | 3dd131e54546e75a7cf39c18805772548269c197 (diff) | |
download | cpython-60783202b8e51b6230d8001bf4ab2fd9e46adf73.tar.gz |
Make test_descr.py pass. Had to disable a few tests, remove references
to 'file', and fix a bunch of subtleties in the behavior of objects
related to overriding __str__. Also disabled a few tests that I couldn't
see how to fix but that seemed to be checking silly stuff only.
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index a0779d4f15..372cf433ca 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -142,13 +142,9 @@ PyFile_WriteObject(PyObject *v, PyObject *f, int flags) if (writer == NULL) return -1; if (flags & Py_PRINT_RAW) { - if (PyUnicode_Check(v)) { - value = v; - Py_INCREF(value); - } else - value = PyObject_Str(v); + value = _PyObject_Str(v); } - else + else value = PyObject_ReprStr8(v); if (value == NULL) { Py_DECREF(writer); |