mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-16 00:37:10 +08:00
Further reduce use of deprecated contextlib aliases (#6370)
This commit is contained in:
@@ -11,6 +11,7 @@ from _typeshed import (
|
||||
StrPath,
|
||||
)
|
||||
from builtins import OSError
|
||||
from contextlib import AbstractContextManager
|
||||
from io import BufferedRandom, BufferedReader, BufferedWriter, FileIO, TextIOWrapper as _TextIOWrapper
|
||||
from posix import listdir as listdir, times_result
|
||||
from subprocess import Popen
|
||||
@@ -20,7 +21,6 @@ from typing import (
|
||||
AnyStr,
|
||||
BinaryIO,
|
||||
Callable,
|
||||
ContextManager,
|
||||
Generic,
|
||||
Iterable,
|
||||
Iterator,
|
||||
@@ -640,7 +640,7 @@ def renames(old: StrOrBytesPath, new: StrOrBytesPath) -> None: ...
|
||||
def replace(src: StrOrBytesPath, dst: StrOrBytesPath, *, src_dir_fd: int | None = ..., dst_dir_fd: int | None = ...) -> None: ...
|
||||
def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = ...) -> None: ...
|
||||
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], ContextManager[_ScandirIterator[AnyStr]]):
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr]]):
|
||||
def __next__(self) -> DirEntry[AnyStr]: ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user