Fix stdlib stubtest for latest Python patch releases (#14220)

This commit is contained in:
Brian Schubert
2025-06-05 22:01:31 -04:00
committed by GitHub
parent 5a619a53e4
commit 74be9177e9
17 changed files with 211 additions and 44 deletions
+7 -10
View File
@@ -1,6 +1,8 @@
import sys
from _typeshed import BytesPath, StrOrBytesPath, StrPath
from genericpath import (
ALLOW_MISSING as ALLOW_MISSING,
_AllowMissingType,
commonprefix as commonprefix,
exists as exists,
getatime as getatime,
@@ -89,6 +91,7 @@ __all__ = [
"sameopenfile",
"samestat",
"commonpath",
"ALLOW_MISSING",
]
if sys.version_info >= (3, 12):
__all__ += ["isjunction", "splitroot"]
@@ -108,16 +111,10 @@ def join(path: StrPath, /, *paths: StrPath) -> str: ...
def join(path: BytesPath, /, *paths: BytesPath) -> bytes: ...
if sys.platform == "win32":
if sys.version_info >= (3, 10):
@overload
def realpath(path: PathLike[AnyStr], *, strict: bool = False) -> AnyStr: ...
@overload
def realpath(path: AnyStr, *, strict: bool = False) -> AnyStr: ...
else:
@overload
def realpath(path: PathLike[AnyStr]) -> AnyStr: ...
@overload
def realpath(path: AnyStr) -> AnyStr: ...
@overload
def realpath(path: PathLike[AnyStr], *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
@overload
def realpath(path: AnyStr, *, strict: bool | _AllowMissingType = False) -> AnyStr: ...
else:
realpath = abspath