summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-08 21:26:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-08 21:26:54 (GMT)
commitcfe5f20fe82806b85c971e43e18564e60108dd08 (patch)
tree0ddd21800971710d6decd02c0c6b867a153c8378 /Modules
parentf9e91c9c58de72afdf51f2a6ebfe50e98beeaa78 (diff)
downloadcpython-cfe5f20fe82806b85c971e43e18564e60108dd08.zip
cpython-cfe5f20fe82806b85c971e43e18564e60108dd08.tar.gz
cpython-cfe5f20fe82806b85c971e43e18564e60108dd08.tar.bz2
Got test_pickletools and test_pickle working.
(Alas, test_cpickle is still broken.)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/cPickle.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/cPickle.c b/Modules/cPickle.c
index 00641d8..639e68b 100644
--- a/Modules/cPickle.c
+++ b/Modules/cPickle.c
@@ -5241,6 +5241,13 @@ cpm_dumps(PyObject *self, PyObject *args, PyObject *kwds)
goto finally;
res = PycStringIO->cgetvalue(file);
+ if (res == NULL)
+ goto finally;
+ if (!PyBytes_Check(res)) {
+ PyObject *tmp = res;
+ res = PyBytes_FromObject(res);
+ Py_DECREF(tmp);
+ }
finally:
Py_XDECREF(pickler);