summaryrefslogtreecommitdiff
path: root/Objects/fileobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-07-11 09:28:11 +0000
committerGuido van Rossum <guido@python.org>2007-07-11 09:28:11 +0000
commit55b4a7b6dc58a49a60f93fa198a6cca1ac28a31a (patch)
tree4a28563e0193c18352f4dd35dca1c2117589849f /Objects/fileobject.c
parentf074b640f913dcf90756676409fc0df841960fb0 (diff)
downloadcpython-git-55b4a7b6dc58a49a60f93fa198a6cca1ac28a31a.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.c8
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);