summaryrefslogtreecommitdiff
path: root/msgpack/fallback.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2018-06-27 01:27:31 +0900
committerInada Naoki <songofacandy@gmail.com>2018-06-27 01:27:31 +0900
commit5f684aed82d0d08079b9aa74e1d41cc2a367833d (patch)
tree230d22ab3a5b909176ee66e2c002bf13109c56cd /msgpack/fallback.py
parentb10cf78f54a5daab866b19c32e45e207d838f52b (diff)
downloadmsgpack-python-5f684aed82d0d08079b9aa74e1d41cc2a367833d.tar.gz
fallback: Fix error on Jython
Fixes #303
Diffstat (limited to 'msgpack/fallback.py')
-rw-r--r--msgpack/fallback.py7
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.",