Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c13f84

Browse files
committed
Simplify code in marshal.c.
1 parent b2677c7 commit 1c13f84

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

Python/marshal.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,6 @@ PyObject *
12391239
PyMarshal_WriteObjectToString(PyObject *x, int version)
12401240
{
12411241
WFILE wf;
1242-
PyObject *res = NULL;
12431242

12441243
wf.fp = NULL;
12451244
wf.readable = NULL;
@@ -1273,12 +1272,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
12731272
:"object too deeply nested to marshal");
12741273
return NULL;
12751274
}
1276-
if (wf.str != NULL) {
1277-
/* XXX Quick hack -- need to do this differently */
1278-
res = PyBytes_FromObject(wf.str);
1279-
Py_DECREF(wf.str);
1280-
}
1281-
return res;
1275+
return wf.str;
12821276
}
12831277

12841278
/* And an interface for Python programs... */

0 commit comments

Comments
 (0)