diff options
author | Adam Chainz <adam@adamj.eu> | 2016-08-17 12:24:24 +0100 |
---|---|---|
committer | Adam Chainz <adam@adamj.eu> | 2016-08-17 12:30:24 +0100 |
commit | 4bed13f9d3da7b913e4ed5470399674fafa8ad11 (patch) | |
tree | c2d800909d7e5d0f7efd9cea586faf5eaf565f11 | |
parent | b75316f17617032c8dfbde2ad7b0d26ba048046a (diff) | |
download | pymemcache-4bed13f9d3da7b913e4ed5470399674fafa8ad11.tar.gz |
Make serde use BytesIO for Python 3 compat
-rw-r--r-- | pymemcache/serde.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/pymemcache/serde.py b/pymemcache/serde.py index 3140046..2226349 100644 --- a/pymemcache/serde.py +++ b/pymemcache/serde.py @@ -14,7 +14,7 @@ import logging import pickle -from six.moves import cStringIO as StringIO +from io import BytesIO try: long_type = long # noqa @@ -40,7 +40,7 @@ def python_memcache_serializer(key, value): value = "%d" % value else: flags |= FLAG_PICKLE - output = StringIO() + output = BytesIO() pickler = pickle.Pickler(output, 0) pickler.dump(value) value = output.getvalue() @@ -60,7 +60,7 @@ def python_memcache_deserializer(key, value, flags): if flags & FLAG_PICKLE: try: - buf = StringIO(value) + buf = BytesIO(value) unpickler = pickle.Unpickler(buf) return unpickler.load() except Exception: |