mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-26 08:00:07 +03:00
one-shot unpack
This commit is contained in:
parent
1fa750a0d7
commit
c360433de7
|
@ -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))
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user