diff options
| author | Antoine Pitrou <solipsis@pitrou.net> | 2012-03-02 18:22:23 +0100 |
|---|---|---|
| committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-03-02 18:22:23 +0100 |
| commit | dc87ffd3df0f0a831b58372ce6f9307cf5da356b (patch) | |
| tree | 312267422faf60d953a446b219386edf0fb6e97d /Python/marshal.c | |
| parent | b52cc6eec0b1ca801bf3324635c1b3dd0ce5acea (diff) | |
| download | cpython-dc87ffd3df0f0a831b58372ce6f9307cf5da356b.tar.gz | |
Simplify code in marshal.c.
Diffstat (limited to 'Python/marshal.c')
| -rw-r--r-- | Python/marshal.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 17353b2d58..77824d4129 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... */ |
