Skip to content

Commit 6c6dcec

Browse files
committed
First try to import Self from typing
1 parent 363217b commit 6c6dcec

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/sage/repl/rich_output/display_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
import warnings
3838
from typing import Any
3939

40-
from typing_extensions import Self
40+
try:
41+
from typing import Self # type: ignore (Python >= 3.11)
42+
except ImportError:
43+
from typing_extensions import Self # type: ignore (Python 3.9, 3.10)
4144

4245
from sage.repl.rich_output.output_basic import (
4346
OutputAsciiArt,

0 commit comments

Comments
 (0)