8000 fallback: Fix error on Jython (#304) · devendor/msgpack-python@aa41e2f · GitHub
[go: up one dir, main page]

Skip to content

Commit aa41e2f

Browse files
authored
fallback: Fix error on Jython (msgpack#304)
Jython doesn't support memoryview += bytes Fixes msgpack#303
2 parents b10cf78 + 5f684ae commit aa41e2f

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