From 6dce674052c1ad3284eb5156fff6ecfe63f43df0 Mon Sep 17 00:00:00 2001 From: Stephen Kent Date: Fri, 22 May 2026 00:08:43 -0700 Subject: [PATCH] Make typing_extensions import conditional on Python version --- copier_python/repo.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/copier_python/repo.py b/copier_python/repo.py index e7a31d1..dcc925f 100644 --- a/copier_python/repo.py +++ b/copier_python/repo.py @@ -3,6 +3,7 @@ import os import re import subprocess +import sys import tempfile from contextlib import contextmanager, suppress from dataclasses import InitVar, dataclass, field @@ -14,7 +15,11 @@ from rich import print # noqa: A004 from rich.panel import Panel from rich.text import Text -from typing_extensions import Self + +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self if TYPE_CHECKING: from collections.abc import Generator, Sequence