Mercurial > cpython-lru_cache-weakref
diff Python/marshal.c @ 75371:61661842f225
Simplify code in marshal.c.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Fri, 02 Mar 2012 18:22:23 +0100 |
| parents | b1303cf15e01 |
| children | e67b3a9bd2dc |
line wrap: on
line diff
--- a/Python/marshal.c Fri Mar 02 18:16:38 2012 +0100 +++ b/Python/marshal.c Fri Mar 02 18:22:23 2012 +0100 @@ -1239,7 +1239,6 @@ PyMarshal_WriteObjectToString(PyObject *x, int version) { WFILE wf; - PyObject *res = NULL; wf.fp = NULL; wf.readable = NULL; @@ -1273,12 +1272,7 @@ :"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... */
