Mercurial > piecrust2
comparison piecrust/fastpickle.py @ 700:76a799eae824
internal: Fix compatibility with older Python 3.x.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Sat, 16 Apr 2016 22:13:22 -0700 |
parents | 9e5393fcfab2 |
children | fcfbe103cfd1 |
comparison
equal
deleted
inserted
replaced
699:3e4049022869 | 700:76a799eae824 |
---|---|
22 return _unpickle_object(data) | 22 return _unpickle_object(data) |
23 | 23 |
24 | 24 |
25 def unpickle_fromb(buf, bufsize): | 25 def unpickle_fromb(buf, bufsize): |
26 with buf.getbuffer() as innerbuf: | 26 with buf.getbuffer() as innerbuf: |
27 data = codecs.decode(innerbuf[:bufsize], encoding='utf8') | 27 data = codecs.decode(innerbuf[:bufsize], 'utf8') |
28 data = json.loads(data) | 28 data = json.loads(data) |
29 return _unpickle_object(data) | 29 return _unpickle_object(data) |
30 | 30 |
31 | 31 |
32 class _WriteWrapper(object): | 32 class _WriteWrapper(object): |