diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-07-06 12:40:33 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 12:40:33 +0900 |
commit | aa41e2fef714da8c02e2cf830d408619d2cf902f (patch) | |
tree | 230d22ab3a5b909176ee66e2c002bf13109c56cd | |
parent | b10cf78f54a5daab866b19c32e45e207d838f52b (diff) | |
parent | 5f684aed82d0d08079b9aa74e1d41cc2a367833d (diff) | |
download | msgpack-python-aa41e2fef714da8c02e2cf830d408619d2cf902f.tar.gz |
fallback: Fix error on Jython (#304)
Jython doesn't support memoryview += bytes
Fixes #303
-rw-r--r-- | msgpack/fallback.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/msgpack/fallback.py b/msgpack/fallback.py index c8c8c78..20ad4c9 100644 --- a/msgpack/fallback.py +++ b/msgpack/fallback.py @@ -100,6 +100,13 @@ def _get_data_from_buffer(obj): return view +# Jython's memoryview support is incomplete +# See https://github.com/msgpack/msgpack-python/issues/303 +_is_jython = sys.platform.startswith('java') +if _is_jython: + _get_data_from_buffer = bytes + + def unpack(stream, **kwargs): warnings.warn( "Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.", |