os.path etc: update for py313 (#11965)

This commit is contained in:
Shantanu
2024-05-18 14:57:44 -07:00
committed by GitHub
parent 2756f16a11
commit 87edeb65d8
3 changed files with 20 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
import sys
from _typeshed import BytesPath, StrPath
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from genericpath import (
commonprefix as commonprefix,
exists as exists,
@@ -47,6 +47,8 @@ from typing_extensions import LiteralString
if sys.version_info >= (3, 12):
from posixpath import isjunction as isjunction, splitroot as splitroot
if sys.version_info >= (3, 13):
from genericpath import isdevdrive as isdevdrive
__all__ = [
"normcase",
@@ -90,6 +92,8 @@ __all__ = [
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
if sys.version_info >= (3, 13):
__all__ += ["isdevdrive", "isreserved"]
altsep: LiteralString
@@ -117,3 +121,6 @@ if sys.platform == "win32":
else:
realpath = abspath
if sys.version_info >= (3, 13):
def isreserved(path: StrOrBytesPath) -> bool: ...