Mercurial > cpython-lru_cache-weakref
diff Objects/fileobject.c @ 42184:bf5d04e0da4c
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.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Wed, 11 Jul 2007 09:28:11 +0000 |
| parents | 825041fc8e2c |
| children | a24e27f05e48 |
line wrap: on
line diff
--- a/Objects/fileobject.c Wed Jul 11 06:56:16 2007 +0000 +++ b/Objects/fileobject.c Wed Jul 11 09:28:11 2007 +0000 @@ -142,13 +142,9 @@ 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);
