File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -266,7 +266,7 @@ def as_bytes_like(self) -> BytesLike:
266266 -------
267267 A bytes-like object that implements the Python buffer protocol
268268 """
269- return memoryview (self .as_numpy_array (). view ( np . uint8 ) ) # type: ignore[arg-type]
269+ return memoryview (self .as_numpy_array ()) # type: ignore[arg-type]
270270
271271 def to_bytes (self ) -> bytes :
272272 """Returns the buffer as `bytes` (host memory).
Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ def _put(
5252 with path .open ("r+b" ) as f :
5353 f .seek (start )
5454 # write takes any object supporting the buffer protocol
55- f .write (value .as_numpy_array ()) # type: ignore[arg-type]
55+ f .write (value .as_bytes_like ())
5656 return None
5757 else :
58- view = memoryview ( value .as_numpy_array ()) # type: ignore[arg-type]
58+ view = value .as_bytes_like ()
5959 if exclusive :
6060 mode = "xb"
6161 else :
You can’t perform that action at this time.
0 commit comments