Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e628783

Browse files
committedAug 27, 2024·
Fix incorrect Self import from typing instead of typing_extensions
1 parent 05c43af commit e628783

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed
 

‎changelog/12744.bugfix.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replaced `typing.Self` with `typing_extensions.Self` -- by :user:`Avasam`

‎src/_pytest/doctest.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444

4545
if TYPE_CHECKING:
4646
import doctest
47-
from typing import Self
47+
48+
from typing_extensions import Self
4849

4950
DOCTEST_REPORT_CHOICE_NONE = "none"
5051
DOCTEST_REPORT_CHOICE_CDIFF = "cdiff"

‎src/_pytest/nodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444

4545
if TYPE_CHECKING:
46-
from typing import Self
46+
from typing_extensions import Self
4747

4848
# Imported here due to circular import.
4949
from _pytest.main import Session

‎src/_pytest/python.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878

7979

8080
if TYPE_CHECKING:
81-
from typing import Self
81+
from typing_extensions import Self
8282

8383

8484
def pytest_addoption(parser: Parser) -> None:

0 commit comments

Comments
 (0)
Please sign in to comment.