From 1c13f84f5554cecbdce8bf42dbfb609c1f72282a Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 2 Mar 2012 18:22:23 +0100 Subject: Simplify code in marshal.c. --- Python/marshal.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Python/marshal.c b/Python/marshal.c index 17353b2..77824d4 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -1239,7 +1239,6 @@ PyObject * PyMarshal_WriteObjectToString(PyObject *x, int version) { WFILE wf; - PyObject *res = NULL; wf.fp = NULL; wf.readable = NULL; @@ -1273,12 +1272,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) :"object too deeply nested to marshal"); return NULL; } - if (wf.str != NULL) { - /* XXX Quick hack -- need to do this differently */ - res = PyBytes_FromObject(wf.str); - Py_DECREF(wf.str); - } - return res; + return wf.str; } /* And an interface for Python programs... */ -- cgit v0.12