mirror of
https://github.com/python/cpython.git
synced 2025-09-15 21:26:04 +00:00
Simplify code in marshal.c.
This commit is contained in:
parent
b2677c7397
commit
1c13f84f55
1 changed files with 1 additions and 7 deletions
|
@ -1239,7 +1239,6 @@ PyObject *
|
||||||
PyMarshal_WriteObjectToString(PyObject *x, int version)
|
PyMarshal_WriteObjectToString(PyObject *x, int version)
|
||||||
{
|
{
|
||||||
WFILE wf;
|
WFILE wf;
|
||||||
PyObject *res = NULL;
|
|
||||||
|
|
||||||
wf.fp = NULL;
|
wf.fp = NULL;
|
||||||
wf.readable = NULL;
|
wf.readable = NULL;
|
||||||
|
@ -1273,12 +1272,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
|
||||||
:"object too deeply nested to marshal");
|
:"object too deeply nested to marshal");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if (wf.str != NULL) {
|
return wf.str;
|
||||||
/* XXX Quick hack -- need to do this differently */
|
|
||||||
res = PyBytes_FromObject(wf.str);
|
|
||||||
Py_DECREF(wf.str);
|
|
||||||
}
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* And an interface for Python programs... */
|
/* And an interface for Python programs... */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue