]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Simplify code in marshal.c.
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 2 Mar 2012 17:22:23 +0000 (18:22 +0100)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 2 Mar 2012 17:22:23 +0000 (18:22 +0100)
Python/marshal.c

index 17353b2d580a6476894a41bbb195e596efb7bf28..77824d4129b8190a3795a67f8a93c48e71ef2feb 100644 (file)
@@ -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... */