Skip to content

Commit 444a15a

Browse files
authored
Merge pull request #71 from eoyilmaz/70-pr-67-breaks-python-below-311
[#70] Updated requirements to include `typing_extensions` for Python …
2 parents 578a1cc + 5d22d28 commit 444a15a

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
__pycache__
22
.coverage
33
.DS_Store
4+
.env
45
.pytest_cache/*
56
.ruff_cache/*
67
.venv/*

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
typing_extensions; python_version < "3.11"

src/timecode/timecode.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,21 @@
44
from __future__ import annotations
55

66
import math
7-
import sys
87
from contextlib import suppress
98
from typing import TYPE_CHECKING, overload
109

11-
if sys.version_info >= (3, 11):
12-
from typing import Self
13-
else:
14-
from typing_extensions import Self
15-
1610
with suppress(ImportError):
1711
from typing import Literal
1812

1913

2014
if TYPE_CHECKING:
15+
import sys
2116
from collections.abc import Iterator
2217
from fractions import Fraction
18+
if sys.version_info >= (3, 11):
19+
from typing import Self
20+
else:
21+
from typing_extensions import Self
2322

2423

2524
class Timecode:

0 commit comments

Comments
 (0)