Skip to content

Commit df59508

Browse files
authored
fix(tags): fixes ImportError on Python >=3.11 (#1363)
1 parent bc8479e commit df59508

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

commitizen/tags.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@
88
from string import Template
99
from typing import TYPE_CHECKING, NamedTuple
1010

11-
from typing_extensions import Self
11+
# Self is Python 3.11+ but backported in typing-extensions
12+
if sys.version_info < (3, 11):
13+
from typing_extensions import Self
14+
else:
15+
from typing import Self
1216

1317
from commitizen import out
1418
from commitizen.defaults import DEFAULT_SETTINGS, Settings, get_tag_regexes

0 commit comments

Comments
 (0)