mirror of
https://github.com/dgelessus/python-rsrcfork.git
synced 2024-11-25 03:34:51 +00:00
Work around false mypy error about SubStream.__enter__
This commit is contained in:
parent
0054d0f7b5
commit
98551263b3
@ -49,6 +49,12 @@ class SubStream(io.BufferedIOBase, typing.BinaryIO):
|
||||
if self._start_offset + self._length > outer_stream_length:
|
||||
raise ValueError(f"start_offset ({self._start_offset}) or length ({self._length}) too high: outer stream must be at least {self._start_offset + self._length} bytes long, but is only {outer_stream_length} bytes")
|
||||
|
||||
# This override does nothing,
|
||||
# but is needed to make mypy happy,
|
||||
# otherwise it complains (apparently incorrectly) about the __enter__ definitions from IOBase and BinaryIO being incompatible with each other.
|
||||
def __enter__(self: "SubStream") -> "SubStream":
|
||||
return super().__enter__()
|
||||
|
||||
def seekable(self) -> bool:
|
||||
return True
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user