mirror of
https://github.com/wassname/ray.git
synced 2026-07-09 09:42:27 +08:00
Python 3.8 compatibility (#7754)
This commit is contained in:
@@ -417,7 +417,7 @@ def _numpy_frombuffer(buffer, dtype, shape, order):
|
||||
array = _frombuffer(buffer, dtype, shape, order)
|
||||
# Unfortunately, numpy does not follow the standard, so we still
|
||||
# have to set the readonly flag for it here.
|
||||
array.setflags(write=not buffer.readonly)
|
||||
array.setflags(write=isinstance(buffer, bytearray) or not buffer.readonly)
|
||||
return array
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user