Skip to content

Commit e77dc81

Browse files
committed
Use typing.NotRequired
1 parent 670a3d9 commit e77dc81

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/PIL/ImageFont.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from enum import IntEnum
3636
from io import BytesIO
3737
from types import ModuleType
38-
from typing import IO, Any, BinaryIO, TypedDict, cast
38+
from typing import IO, Any, BinaryIO, NotRequired, TypedDict, cast
3939

4040
from . import Image
4141
from ._typing import StrOrBytesPath
@@ -52,7 +52,7 @@ class Axis(TypedDict):
5252
minimum: int | None
5353
default: int | None
5454
maximum: int | None
55-
name: bytes | None
55+
name: NotRequired[bytes]
5656

5757

5858
class Layout(IntEnum):
@@ -732,7 +732,7 @@ def get_variation_axes(self) -> list[Axis]:
732732
"""
733733
axes = self.font.getvaraxes()
734734
for axis in axes:
735-
if axis["name"]:
735+
if "name" in axis:
736736
axis["name"] = axis["name"].replace(b"\x00", b"")
737737
return axes
738738

0 commit comments

Comments
 (0)