summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-03-02 17:22:23 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-03-02 17:22:23 (GMT)
commit1c13f84f5554cecbdce8bf42dbfb609c1f72282a (patch)
tree5c5dc10ef4e0cc97c02ab3e3e9d3d28b0e8d862d
parentb2677c739729ace08c4185d1e459210373477497 (diff)
downloadcpython-1c13f84f5554cecbdce8bf42dbfb609c1f72282a.zip
cpython-1c13f84f5554cecbdce8bf42dbfb609c1f72282a.tar.gz
cpython-1c13f84f5554cecbdce8bf42dbfb609c1f72282a.tar.bz2
Simplify code in marshal.c.
-rw-r--r--Python/marshal.c8
1 files changed, 1 insertions, 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... */