Skip to content

Commit 04f0339

Browse files
committed
Added python version check for typing_Extensions
1 parent 29b77cf commit 04f0339

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

beets/metadata_plugins.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99

1010
import abc
1111
import re
12+
import sys
1213
from typing import TYPE_CHECKING, Generic, Literal, Sequence, TypedDict, TypeVar
1314

14-
from typing_extensions import NotRequired
15-
1615
from beets.util import cached_classproperty
1716
from beets.util.id_extractors import extract_release_id
1817

1918
from .plugins import BeetsPlugin, find_plugins, notify_info_yielded, send
2019

20+
if sys.version_info >= (3, 11):
21+
from typing import NotRequired
22+
else:
23+
from typing_extensions import NotRequired
24+
2125
if TYPE_CHECKING:
2226
from collections.abc import Iterable
2327

0 commit comments

Comments
 (0)