8000 fallback: Fix error on Jython · Martiniele/msgpack-python@5f684ae · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 5f684ae

Browse files
committed
fallback: Fix error on Jython
Fixes msgpack#303
1 parent b10cf78 commit 5f684ae

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

msgpack/fallback.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ def _get_data_from_buffer(obj):
100100
return view
101101

102102

103+
# Jython's memoryview support is incomplete
104+
# See https://github.com/msgpack/msgpack-python/issues/303
105+
_is_jython = sys.platform.startswith('java')
106+
if _is_jython:
107+
_get_data_from_buffer = bytes
108+
109+
103110
def unpack(stream, **kwargs):
104111
warnings.warn(
105112
"Direct calling implementation's unpack() is deprecated, Use msgpack.unpack() or unpackb() instead.",

0 commit comments

Comments
 (0)
0