Skip to content

Commit

Permalink
Fix compatibility with Python 3.14.0a1
Browse files Browse the repository at this point in the history
typing.ByteString has been removed, port to the recommended, backwards
comptible alternative.

Documentation (see: https://docs.python.org/3/library/typing.html#typing.ByteString):
Prefer collections.abc.Buffer, or a union like bytes | bytearray | memoryview.
  • Loading branch information
befeleme committed Nov 13, 2024
1 parent 0e26bfe commit 78aac75
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cairo/__init__.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import (Any, BinaryIO, ByteString, Callable, Generic, List, Optional,
from typing import (Any, BinaryIO, Callable, Generic, List, Optional,
Sequence, Text, Tuple, TypeVar, Union)

del annotations
Expand Down Expand Up @@ -1975,6 +1975,7 @@ class Device:
def __enter__(self: _SomeDevice) -> _SomeDevice: ...
__exit__: Any = ...

ByteString = Union[bytes, bytearray, memoryview]
_PathLike = Union[Text, ByteString]
_FileLike = BinaryIO
_SomeSurface = TypeVar("_SomeSurface", bound="Surface")
Expand Down

0 comments on commit 78aac75

Please sign in to comment.