mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-10 05:22:23 +08:00
Fixing flake8 E401, E402 errors
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
# Stubs for email.parser (Python 3.4)
|
||||
|
||||
from typing import Callable, Optional, TextIO, BinaryIO
|
||||
import email.feedparser
|
||||
from email.message import Message
|
||||
import sys
|
||||
from typing import Callable, Optional, TextIO, BinaryIO
|
||||
if sys.version_info >= (3, 3):
|
||||
from email.policy import Policy
|
||||
import sys
|
||||
|
||||
FeedParser = email.feedparser.FeedParser
|
||||
BytesFeedParser = email.feedparser.BytesFeedParser
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Stubs for email.policy (Python 3.4)
|
||||
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Optional, Tuple, Union, Callable
|
||||
import sys
|
||||
from email.message import Message
|
||||
@@ -7,7 +8,6 @@ from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
if sys.version_info >= (3, 4):
|
||||
from email.contentmanager import ContentManager
|
||||
from abc import abstractmethod
|
||||
|
||||
if sys.version_info >= (3, 3):
|
||||
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
from abc import ABCMeta, abstractmethod
|
||||
if sys.version_info >= (3, 4):
|
||||
from _importlib_modulespec import ModuleSpec
|
||||
import sys
|
||||
import types
|
||||
from typing import Any, Mapping, Optional, Sequence, Tuple, Union
|
||||
|
||||
_Path = Union[bytes, str]
|
||||
|
||||
# Loader is exported from this module, but for circular import reasons
|
||||
# exists in its own stub file (with ModuleSpec and ModuleType).
|
||||
from _importlib_modulespec import Loader as Loader # Exported
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
from _importlib_modulespec import ModuleSpec
|
||||
|
||||
_Path = Union[bytes, str]
|
||||
|
||||
class Finder(metaclass=ABCMeta): ...
|
||||
# Technically this class defines the following method, but its subclasses
|
||||
# in this module violate its signature. Since this class is deprecated, it's
|
||||
|
||||
@@ -3,12 +3,13 @@
|
||||
|
||||
# based on http: //docs.python.org/3.2/library/os.html
|
||||
|
||||
from builtins import OSError as error
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
import sys
|
||||
from typing import (
|
||||
Mapping, MutableMapping, Dict, List, Any, Tuple, Iterator, overload, Union, AnyStr,
|
||||
Optional, Generic, Set, Callable
|
||||
)
|
||||
import sys
|
||||
from builtins import OSError as error
|
||||
from . import path
|
||||
|
||||
# ----- os variables -----
|
||||
@@ -323,7 +324,6 @@ def killpg(pgid: int, sig: int) -> None: ... # Unix only
|
||||
def nice(increment: int) -> int: ... # Unix only
|
||||
def plock(op: int) -> None: ... # Unix only ???op is int?
|
||||
|
||||
from io import TextIOWrapper as _TextIOWrapper
|
||||
class popen(_TextIOWrapper):
|
||||
# TODO 'b' modes or bytes command not accepted?
|
||||
def __init__(self, command: str, mode: str = ...,
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
# Stubs for platform (Python 3.5)
|
||||
|
||||
from typing import Tuple, NamedTuple
|
||||
|
||||
from os import devnull as DEV_NULL
|
||||
from os import popen
|
||||
from typing import Tuple, NamedTuple
|
||||
|
||||
def libc_ver(executable: str = ..., lib: str = ..., version: str = ..., chunksize: int = ...) -> Tuple[str, str]: ...
|
||||
def linux_distribution(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ..., full_distribution_name: bool = ...) -> Tuple[str, str, str]: ...
|
||||
def dist(distname: str = ..., version: str = ..., id: str = ..., supported_dists: Tuple[str, ...] = ...) -> Tuple[str, str, str]: ...
|
||||
from os import popen
|
||||
def win32_ver(release: str = ..., version: str = ..., csd: str = ..., ptype: str = ...) -> Tuple[str, str, str, str]: ...
|
||||
def mac_ver(release: str = ..., versioninfo: Tuple[str, str, str] = ..., machine: str = ...) -> Tuple[str, Tuple[str, str, str], str]: ...
|
||||
def java_ver(release: str = ..., vendor: str = ..., vminfo: Tuple[str, str, str] = ..., osinfo: Tuple[str, str, str] = ...) -> Tuple[str, str, Tuple[str, str, str], Tuple[str, str, str]]: ...
|
||||
|
||||
@@ -9,6 +9,10 @@ from typing import (
|
||||
Union, overload
|
||||
)
|
||||
|
||||
# ModuleType is exported from this module, but for circular import
|
||||
# reasons exists in its own stub file (with ModuleSpec and Loader).
|
||||
from _importlib_modulespec import ModuleType as ModuleType # Exported
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_KT = TypeVar('_KT')
|
||||
_VT = TypeVar('_VT')
|
||||
@@ -107,10 +111,6 @@ class BuiltinFunctionType:
|
||||
def __call__(self, *args: Any, **kwargs: Any) -> Any: ...
|
||||
BuiltinMethodType = BuiltinFunctionType
|
||||
|
||||
# ModuleType is exported from this module, but for circular import
|
||||
# reasons exists in its own stub file (with ModuleSpec and Loader).
|
||||
from _importlib_modulespec import ModuleType as ModuleType # Exported
|
||||
|
||||
class TracebackType:
|
||||
tb_frame = ... # type: FrameType
|
||||
tb_lasti = ... # type: int
|
||||
|
||||
Reference in New Issue
Block a user