summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/object.c b/Objects/object.c
index 607f047..ab1baa7 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -375,8 +375,9 @@ PyObject_Print(PyObject *op, FILE *fp, int flags)
else if (PyUnicode_Check(s)) {
PyObject *t;
t = PyUnicode_AsEncodedString(s, "utf-8", "backslashreplace");
- if (t == NULL)
- ret = 0;
+ if (t == NULL) {
+ ret = -1;
+ }
else {
fwrite(PyBytes_AS_STRING(t), 1,
PyBytes_GET_SIZE(t), fp);