one-shot unpack

This commit is contained in:
Juan Riaza 2013-01-05 19:00:10 +01:00
parent 1fa750a0d7
commit c360433de7
2 changed files with 3 additions and 4 deletions

View File

@ -95,10 +95,9 @@ class MessagePackParser(BaseParser):
`files` will always be `None`.
"""
try:
return msgpack.Unpacker(
stream,
return msgpack.unpackb(stream,
use_list=True,
object_hook=self._decode_object).unpack()
object_hook=self._decode_object)
except Exception, exc:
raise ParseError('MessagePack parse error - %s' % unicode(exc))

View File

@ -351,7 +351,7 @@ if msgpack:
parser = MessagePackParser()
content = renderer.render(obj, 'application/msgpack')
data = parser.parse(StringIO(content))
data = parser.parse(content)
self.assertEquals(obj, data)