Replace PathLike unions with aliases from _typeshed (#5467)

Standardize on 'from os import PathLike'
This commit is contained in:
Sebastian Rittau
2021-05-16 21:38:00 +02:00
committed by GitHub
parent d72b1e8149
commit e5abd08f93
9 changed files with 30 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
import os
import types
from _typeshed import StrPath
from os import PathLike
from typing import IO, Any, List, Optional, Protocol, Tuple, TypeVar, Union
from _imp import (
@@ -57,7 +57,7 @@ def load_module(name: str, file: Optional[_FileLike], filename: str, details: Tu
# IO[Any] is a TextIOWrapper if name is a .py file, and a FileIO otherwise.
def find_module(
name: str, path: Union[None, List[str], List[os.PathLike[str]], List[StrPath]] = ...
name: str, path: Union[None, List[str], List[PathLike[str]], List[StrPath]] = ...
) -> Tuple[IO[Any], str, Tuple[str, str, int]]: ...
def reload(module: types.ModuleType) -> types.ModuleType: ...
def init_builtin(name: str) -> Optional[types.ModuleType]: ...