mirror of
https://github.com/msgpack/msgpack-python.git
synced 2025-10-20 04:13:16 +00:00
parent
60ef3879d7
commit
d9ec8fc905
2 changed files with 12 additions and 6 deletions
|
@ -848,7 +848,11 @@ class Packer(object):
|
|||
raise TypeError("Cannot serialize %r" % (obj, ))
|
||||
|
||||
def pack(self, obj):
|
||||
self._pack(obj)
|
||||
try:
|
||||
self._pack(obj)
|
||||
except:
|
||||
self._buffer = StringIO() # force reset
|
||||
raise
|
||||
ret = self._buffer.getvalue()
|
||||
if self._autoreset:
|
||||
self._buffer = StringIO()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue