Update pathlib to 3.12 (#10646)

This commit is contained in:
Nikita Sobolev
2023-09-01 15:53:58 +03:00
committed by GitHub
parent 9552ec7f72
commit e04c440571
2 changed files with 15 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ from _typeshed import (
ReadableBuffer,
StrOrBytesPath,
StrPath,
Unused,
)
from collections.abc import Callable, Generator, Iterator, Sequence
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper
@@ -38,7 +39,12 @@ class PurePath(PathLike[str]):
def suffixes(self) -> list[str]: ...
@property
def stem(self) -> str: ...
def __new__(cls, *args: StrPath) -> Self: ...
if sys.version_info >= (3, 12):
def __new__(cls, *args: StrPath, **kwargs: Unused) -> Self: ...
def __init__(self, *args: StrPath) -> None: ...
else:
def __new__(cls, *args: StrPath) -> Self: ...
def __hash__(self) -> int: ...
def __eq__(self, other: object) -> bool: ...
def __fspath__(self) -> str: ...
@@ -53,7 +59,9 @@ class PurePath(PathLike[str]):
def as_uri(self) -> str: ...
def is_absolute(self) -> bool: ...
def is_reserved(self) -> bool: ...
if sys.version_info >= (3, 9):
if sys.version_info >= (3, 12):
def is_relative_to(self, __other: StrPath, *_deprecated: StrPath) -> bool: ...
elif sys.version_info >= (3, 9):
def is_relative_to(self, *other: StrPath) -> bool: ...
if sys.version_info >= (3, 12):
@@ -61,7 +69,11 @@ class PurePath(PathLike[str]):
else:
def match(self, path_pattern: str) -> bool: ...
def relative_to(self, *other: StrPath) -> Self: ...
if sys.version_info >= (3, 12):
def relative_to(self, __other: StrPath, *_deprecated: StrPath, walk_up: bool = False) -> Self: ...
else:
def relative_to(self, *other: StrPath) -> Self: ...
def with_name(self, name: str) -> Self: ...
if sys.version_info >= (3, 9):
def with_stem(self, stem: str) -> Self: ...

View File

@@ -17,10 +17,6 @@ importlib.metadata._meta.PackageMetadata.get
importlib.metadata._meta.SimplePath.__truediv__
importlib.metadata._meta.SimplePath.parent
importlib.resources.files
pathlib.Path.__init__
pathlib.PurePath.__init__
pathlib.PurePath.is_relative_to
pathlib.PurePath.relative_to
poplib.POP3_SSL.__init__
smtplib.SMTP.starttls
smtplib.SMTP_SSL.__init__