diff options
author | INADA Naoki <inada-n@klab.com> | 2013-02-23 18:11:46 +0900 |
---|---|---|
committer | INADA Naoki <inada-n@klab.com> | 2013-02-23 18:11:46 +0900 |
commit | 38a9ad98c9e8e8b73efb9726554737a60ec215c9 (patch) | |
tree | da34edb37f4446de89bfe85de2e9b4ee1ca53f9b /msgpack/fallback.py | |
parent | a6859791a2048f5b2aae1ece03a603af63d69633 (diff) | |
download | msgpack-python-38a9ad98c9e8e8b73efb9726554737a60ec215c9.tar.gz |
Revert skipping reserved byte.
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r-- | msgpack/fallback.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py index f893e1a..e9dddd6 100644 --- a/msgpack/fallback.py +++ b/msgpack/fallback.py @@ -48,7 +48,7 @@ from msgpack.exceptions import ( PackValueError, ExtraData) -EX_SKIP = 0 +EX_SKIP = 0 EX_CONSTRUCT = 1 EX_READ_ARRAY_HEADER = 2 EX_READ_MAP_HEADER = 3 @@ -57,7 +57,6 @@ TYPE_IMMEDIATE = 0 TYPE_ARRAY = 1 TYPE_MAP = 2 TYPE_RAW = 3 -TYPE_RESERVED = 4 DEFAULT_RECURSE_LIMIT=511 @@ -338,13 +337,11 @@ class Unpacker(object): n = struct.unpack(">I", self._fb_read(4, write_bytes))[0] typ = TYPE_MAP else: - typ = TYPE_RESERVED + raise UnpackValueError("Unknown header: 0x%x" % b) return typ, n, obj def _fb_unpack(self, execute=EX_CONSTRUCT, write_bytes=None): - typ = TYPE_RESERVED - while typ == TYPE_RESERVED: - typ, n, obj = self._read_header(execute, write_bytes) + typ, n, obj = self._read_header(execute, write_bytes) if execute == EX_READ_ARRAY_HEADER: if typ != TYPE_ARRAY: |