Use lowercase type everywhere (#6853)

This commit is contained in:
Alex Waygood
2022-01-08 15:09:29 +00:00
committed by GitHub
parent f8501d33c7
commit a40d79a4e6
172 changed files with 728 additions and 761 deletions

View File

@@ -2,7 +2,7 @@ import builtins
import ctypes
import sys
from types import TracebackType
from typing import Any, Type, TypeVar
from typing import Any, TypeVar
if sys.platform == "win32":
@@ -37,7 +37,7 @@ if sys.platform == "win32":
def write(self, msg: bytes) -> None: ...
def read(self, n: int) -> bytes: ...
def __exit__(
self, exc_type: Type[BaseException] | None, exc_val: BaseException | None, tb: TracebackType | None
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, tb: TracebackType | None
) -> None: ...
READ_CONTROL: int
STANDARD_RIGHTS_REQUIRED: int

View File

@@ -1,5 +1,5 @@
from socket import socket
from typing import Iterable, Mapping, NoReturn, Type
from typing import Iterable, Mapping, NoReturn
from paramiko.channel import Channel, ChannelFile, ChannelStderrFile, ChannelStdinFile
from paramiko.hostkeys import HostKeys
@@ -15,7 +15,7 @@ class SSHClient(ClosingContextManager):
def save_host_keys(self, filename: str) -> None: ...
def get_host_keys(self) -> HostKeys: ...
def set_log_channel(self, name: str) -> None: ...
def set_missing_host_key_policy(self, policy: Type[MissingHostKeyPolicy] | MissingHostKeyPolicy) -> None: ...
def set_missing_host_key_policy(self, policy: type[MissingHostKeyPolicy] | MissingHostKeyPolicy) -> None: ...
def connect(
self,
hostname: str,

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, Callable, Sequence, Type
from typing import IO, Any, Callable, Sequence
from cryptography.hazmat.primitives.asymmetric.ec import EllipticCurve, EllipticCurvePrivateKey, EllipticCurvePublicKey
from cryptography.hazmat.primitives.hashes import HashAlgorithm
@@ -9,15 +9,15 @@ class _ECDSACurve:
nist_name: str
key_length: int
key_format_identifier: str
hash_object: Type[HashAlgorithm]
curve_class: Type[EllipticCurve]
def __init__(self, curve_class: Type[EllipticCurve], nist_name: str) -> None: ...
hash_object: type[HashAlgorithm]
curve_class: type[EllipticCurve]
def __init__(self, curve_class: type[EllipticCurve], nist_name: str) -> None: ...
class _ECDSACurveSet:
ecdsa_curves: Sequence[_ECDSACurve]
def __init__(self, ecdsa_curves: Sequence[_ECDSACurve]) -> None: ...
def get_key_format_identifier_list(self) -> list[str]: ...
def get_by_curve_class(self, curve_class: Type[Any]) -> _ECDSACurve | None: ...
def get_by_curve_class(self, curve_class: type[Any]) -> _ECDSACurve | None: ...
def get_by_key_format_identifier(self, key_format_identifier: str) -> _ECDSACurve | None: ...
def get_by_key_length(self, key_length: int) -> _ECDSACurve | None: ...

View File

@@ -1,4 +1,4 @@
from typing import IO, Pattern, Type, TypeVar
from typing import IO, Pattern, TypeVar
from paramiko.message import Message
@@ -24,9 +24,9 @@ class PKey:
def sign_ssh_data(self, data: bytes) -> Message: ...
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
@classmethod
def from_private_key_file(cls: Type[_PK], filename: str, password: str | None = ...) -> _PK: ...
def from_private_key_file(cls: type[_PK], filename: str, password: str | None = ...) -> _PK: ...
@classmethod
def from_private_key(cls: Type[_PK], file_obj: IO[str], password: str | None = ...) -> _PK: ...
def from_private_key(cls: type[_PK], file_obj: IO[str], password: str | None = ...) -> _PK: ...
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
def load_certificate(self, value: Message | str) -> None: ...

View File

@@ -1,14 +1,14 @@
import sys
from typing import Any, Iterable, Sequence, Text, Type, TypeVar
from typing import Any, Iterable, Sequence, Text, TypeVar
_T = TypeVar("_T")
PY2: bool
string_types: Type[Any] | Sequence[Type[Any]]
text_type: Type[Any] | Sequence[Type[Any]]
bytes_types: Type[Any] | Sequence[Type[Any]]
integer_types: Type[Any] | Sequence[Type[Any]]
string_types: type[Any] | Sequence[type[Any]]
text_type: type[Any] | Sequence[type[Any]]
bytes_types: type[Any] | Sequence[type[Any]]
integer_types: type[Any] | Sequence[type[Any]]
long = int
def input(prompt: Any) -> str: ...

View File

@@ -1,5 +1,5 @@
from logging import Logger
from typing import Any, Type
from typing import Any
from paramiko.channel import Channel
from paramiko.server import ServerInterface, SubsystemHandler
@@ -18,7 +18,7 @@ class SFTPServer(BaseSFTP, SubsystemHandler):
server: SFTPServerInterface
sock: Channel | None
def __init__(
self, channel: Channel, name: str, server: ServerInterface, sftp_si: Type[SFTPServerInterface], *largs: Any, **kwargs: Any
self, channel: Channel, name: str, server: ServerInterface, sftp_si: type[SFTPServerInterface], *largs: Any, **kwargs: Any
) -> None: ...
def start_subsystem(self, name: str, transport: Transport, channel: Channel) -> None: ...
def finish_subsystem(self) -> None: ...

View File

@@ -1,7 +1,7 @@
from typing import Any, Type
from typing import Any
GSS_AUTH_AVAILABLE: bool
GSS_EXCEPTIONS: tuple[Type[Exception], ...]
GSS_EXCEPTIONS: tuple[type[Exception], ...]
def GSSAuth(auth_method: str, gss_deleg_creds: bool = ...) -> _SSH_GSSAuth: ...

View File

@@ -2,7 +2,7 @@ from logging import Logger
from socket import socket
from threading import Condition, Event, Lock, Thread
from types import ModuleType
from typing import Any, Callable, Iterable, Protocol, Sequence, Type
from typing import Any, Callable, Iterable, Protocol, Sequence
from paramiko.auth_handler import AuthHandler, _InteractiveCallback
from paramiko.channel import Channel
@@ -67,7 +67,7 @@ class Transport(Thread, ClosingContextManager):
server_key_dict: dict[str, PKey]
server_accepts: list[Channel]
server_accept_cv: Condition
subsystem_table: dict[str, tuple[Type[SubsystemHandler], tuple[Any, ...], dict[str, Any]]]
subsystem_table: dict[str, tuple[type[SubsystemHandler], tuple[Any, ...], dict[str, Any]]]
sys: ModuleType
def __init__(
self,
@@ -138,7 +138,7 @@ class Transport(Thread, ClosingContextManager):
gss_trust_dns: bool = ...,
) -> None: ...
def get_exception(self) -> Exception | None: ...
def set_subsystem_handler(self, name: str, handler: Type[SubsystemHandler], *larg: Any, **kwarg: Any) -> None: ...
def set_subsystem_handler(self, name: str, handler: type[SubsystemHandler], *larg: Any, **kwarg: Any) -> None: ...
def is_authenticated(self) -> bool: ...
def get_username(self) -> str | None: ...
def get_banner(self) -> bytes | None: ...

View File

@@ -1,7 +1,7 @@
import sys
from logging import Logger, LogRecord
from types import TracebackType
from typing import IO, AnyStr, Callable, Protocol, Type, TypeVar
from typing import IO, AnyStr, Callable, Protocol, TypeVar
from paramiko.config import SSHConfig, SSHConfigDict
from paramiko.hostkeys import HostKeys
@@ -28,7 +28,7 @@ def format_binary_line(data: bytes) -> str: ...
def safe_string(s: bytes) -> bytes: ...
def bit_length(n: int) -> int: ...
def tb_strings() -> list[str]: ...
def generate_key_bytes(hash_alg: Type[_Hash], salt: bytes, key: bytes | str, nbytes: int) -> bytes: ...
def generate_key_bytes(hash_alg: type[_Hash], salt: bytes, key: bytes | str, nbytes: int) -> bytes: ...
def load_host_keys(filename: str) -> HostKeys: ...
def parse_ssh_config(file_obj: IO[str]) -> SSHConfig: ...
def lookup_ssh_host_config(hostname: str, config: SSHConfig) -> SSHConfigDict: ...
@@ -46,7 +46,7 @@ def constant_time_bytes_eq(a: AnyStr, b: AnyStr) -> bool: ...
class ClosingContextManager:
def __enter__(self: _TC) -> _TC: ...
def __exit__(
self, type: Type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
self, type: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
) -> None: ...
def clamp_value(minimum: int, val: int, maximum: int) -> int: ...