summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_pickle.py
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 /Lib/test/test_pickle.py
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 'Lib/test/test_pickle.py')
-rw-r--r--Lib/test/test_pickle.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_pickle.py b/Lib/test/test_pickle.py
index 585644e..11254f4 100644
--- a/Lib/test/test_pickle.py
+++ b/Lib/test/test_pickle.py
@@ -1,6 +1,6 @@
import pickle
import unittest
-from cStringIO import StringIO
+import io
from test import test_support
@@ -26,16 +26,16 @@ class PicklerTests(AbstractPickleTests):
error = KeyError
def dumps(self, arg, proto=0, fast=0):
- f = StringIO()
+ f = io.BytesIO()
p = pickle.Pickler(f, proto)
if fast:
p.fast = fast
p.dump(arg)
f.seek(0)
- return f.read()
+ return bytes(f.read())
def loads(self, buf):
- f = StringIO(buf)
+ f = io.BytesIO(buf)
u = pickle.Unpickler(f)
return u.load()
@@ -45,7 +45,7 @@ class PersPicklerTests(AbstractPersistentPicklerTests):
class PersPickler(pickle.Pickler):
def persistent_id(subself, obj):
return self.persistent_id(obj)
- f = StringIO()
+ f = io.BytesIO()
p = PersPickler(f, proto)
if fast:
p.fast = fast
@@ -57,7 +57,7 @@ class PersPicklerTests(AbstractPersistentPicklerTests):
class PersUnpickler(pickle.Unpickler):
def persistent_load(subself, obj):
return self.persistent_load(obj)
- f = StringIO(buf)
+ f = io.BytesIO(buf)
u = PersUnpickler(f)
return u.load()