diff options
Diffstat (limited to 'Objects/fileobject.c')
-rw-r--r-- | Objects/fileobject.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index 7ed4fcd..518fe04 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c @@ -680,16 +680,13 @@ writeobject(v, f, flags) writer = getattr(f, "write"); if (writer == NULL) return -1; - if ((flags & PRINT_RAW) && is_stringobject(v)) { - value = v; - INCREF(value); - } - else { + if (flags & PRINT_RAW) + value = strobject(v); + else value = reprobject(v); - if (value == NULL) { - DECREF(writer); - return -1; - } + if (value == NULL) { + DECREF(writer); + return -1; } result = call_object(writer, value); DECREF(writer); |