From 491e638afccc3118086e473c77b803833de09f47 Mon Sep 17 00:00:00 2001 From: Andreas Poehlmann Date: Tue, 3 Sep 2024 22:06:45 +0200 Subject: [PATCH] upath.implementations.local: guard import Self --- upath/implementations/local.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/upath/implementations/local.py b/upath/implementations/local.py index 87ae228..4ecca0b 100644 --- a/upath/implementations/local.py +++ b/upath/implementations/local.py @@ -4,11 +4,16 @@ from pathlib import PosixPath from pathlib import WindowsPath from typing import Any -from typing import Self from urllib.parse import SplitResult +if sys.version_info >= (3, 11): + from typing import Self +else: + from typing_extensions import Self + from upath._uris import compatible_protocol from upath.core import UPath +from upath.core import UPathLike __all__ = [ "LocalPath", @@ -17,8 +22,6 @@ "WindowsUPath", ] -from upath.core import UPathLike - _LISTDIR_WORKS_ON_FILES: bool | None = None