From 585a3674b358230fbf423055a65c49a9a6947180 Mon Sep 17 00:00:00 2001 From: Aiqin Zhang Date: Wed, 20 Sep 2023 11:34:31 +1000 Subject: [PATCH] remove Buffer type to make it compatible with python 3.10 and above --- rohmu/util.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rohmu/util.py b/rohmu/util.py index 7738de4c..9cef97ff 100644 --- a/rohmu/util.py +++ b/rohmu/util.py @@ -10,7 +10,6 @@ from itertools import islice from rohmu.typing import HasFileno from typing import BinaryIO, Generator, Iterable, Optional, Tuple, TypeVar, Union -from typing_extensions import Buffer import fcntl import logging @@ -205,10 +204,10 @@ def seek(self, offset: int, whence: int = 0) -> int: def truncate(self, size: Optional[int] = None) -> int: raise UnsupportedOperation("truncate") - def write(self, s: Union[bytes, Buffer]) -> int: + def write(self, s: bytes) -> int: # type: ignore raise UnsupportedOperation("write") - def writelines(self, __lines: Union[Iterable[bytes], Iterable[Buffer]]) -> None: + def writelines(self, __lines: Iterable[bytes]) -> None: # type: ignore raise UnsupportedOperation("writelines") def fileno(self) -> int: