summaryrefslogtreecommitdiffstats
path: root/Python/marshal.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-04 00:41:39 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-04 00:41:39 (GMT)
commitf15a29f975bbdef6de0aa19a19b176d1baf8f5ab (patch)
tree60f4f72289129eaa808e05f2b7c7fb7bde077371 /Python/marshal.c
parentbae5cedb8d41edc20bea54b8bff0c7f835de8043 (diff)
downloadcpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.zip
cpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.tar.gz
cpython-f15a29f975bbdef6de0aa19a19b176d1baf8f5ab.tar.bz2
More coding by random modification.
Encoding now return bytes instead of str8. eval(), exec(), compile() now accept unicode or bytes.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r--Python/marshal.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Python/marshal.c b/Python/marshal.c
index 94d73a0..9243798 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -263,14 +263,14 @@ w_object(PyObject *v, WFILE *p)
return;
}
w_byte(TYPE_UNICODE, p);
- n = PyString_GET_SIZE(utf8);
+ n = PyBytes_GET_SIZE(utf8);
if (n > INT_MAX) {
p->depth--;
p->error = 1;
return;
}
w_long((long)n, p);
- w_string(PyString_AS_STRING(utf8), (int)n, p);
+ w_string(PyBytes_AS_STRING(utf8), (int)n, p);
Py_DECREF(utf8);
}
else if (PyTuple_Check(v)) {
@@ -1031,7 +1031,7 @@ PyMarshal_WriteObjectToString(PyObject *x, int version)
if (wf.ptr - base > PY_SSIZE_T_MAX) {
Py_DECREF(wf.str);
PyErr_SetString(PyExc_OverflowError,
- "too much marshall data for a string");
+ "too much marshal data for a string");
return NULL;
}
_PyString_Resize(&wf.str, (Py_ssize_t)(wf.ptr - base));