mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 21:12:25 +08:00
future first: switch the order of some if statements (#5206)
Since we're adding this to our contribution guidelines in https://github.com/python/typeshed/pull/5205
This commit is contained in:
@@ -99,12 +99,12 @@ max_byte: bytes
|
||||
cr_byte: bytes
|
||||
linefeed_byte: bytes
|
||||
crlf: bytes
|
||||
if sys.version_info < (3, 0):
|
||||
cr_byte_value: bytes
|
||||
linefeed_byte_value: bytes
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
cr_byte_value: int
|
||||
linefeed_byte_value: int
|
||||
else:
|
||||
cr_byte_value: bytes
|
||||
linefeed_byte_value: bytes
|
||||
|
||||
class _SupportsAsBytes(Protocol):
|
||||
def asbytes(self) -> bytes: ...
|
||||
|
||||
@@ -6,10 +6,10 @@ from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
|
||||
from paramiko.message import Message
|
||||
from paramiko.transport import Transport
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
c_MSG_KEXECDH_INIT: bytes
|
||||
c_MSG_KEXECDH_REPLY: bytes
|
||||
|
||||
@@ -6,10 +6,10 @@ from cryptography.hazmat.primitives.asymmetric.ec2 import EllipticCurve, Ellipti
|
||||
from paramiko.message import Message
|
||||
from paramiko.transport import Transport
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
c_MSG_KEXECDH_INIT: bytes
|
||||
c_MSG_KEXECDH_REPLY: bytes
|
||||
|
||||
@@ -5,10 +5,10 @@ from typing import Callable, Optional
|
||||
from paramiko.message import Message
|
||||
from paramiko.transport import Transport
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
c_MSG_KEXDH_GEX_REQUEST_OLD: bytes
|
||||
c_MSG_KEXDH_GEX_GROUP: bytes
|
||||
|
||||
@@ -5,10 +5,10 @@ from typing import Callable
|
||||
from paramiko.message import Message
|
||||
from paramiko.transport import Transport
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
c_MSG_KEXDH_INIT: bytes
|
||||
c_MSG_KEXDH_REPLY: bytes
|
||||
|
||||
@@ -4,10 +4,10 @@ from typing import Callable
|
||||
|
||||
from paramiko.kex_group1 import KexGroup1 as KexGroup1
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
class KexGroup14(KexGroup1):
|
||||
P: int
|
||||
|
||||
@@ -4,10 +4,10 @@ from typing import Callable
|
||||
|
||||
from paramiko.kex_group1 import KexGroup1 as KexGroup1
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
class KexGroup16SHA512(KexGroup1):
|
||||
name: str
|
||||
|
||||
@@ -3,12 +3,12 @@ from typing import Any, Iterable, List, Optional, Text
|
||||
|
||||
from .common import _LikeBytes
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
if sys.version_info >= (3, 0):
|
||||
from io import BytesIO
|
||||
else:
|
||||
from StringIO import StringIO
|
||||
|
||||
BytesIO = StringIO[bytes]
|
||||
else:
|
||||
from io import BytesIO
|
||||
|
||||
class Message:
|
||||
big_int: int
|
||||
|
||||
@@ -7,10 +7,10 @@ from cryptography.hazmat.primitives.ciphers import Cipher
|
||||
from paramiko.compress import ZlibCompressor, ZlibDecompressor
|
||||
from paramiko.message import Message
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
def compute_hmac(key: bytes, message: bytes, digest_class: _Hash) -> bytes: ...
|
||||
|
||||
|
||||
@@ -16,18 +16,18 @@ def input(prompt: Any) -> str: ...
|
||||
def decodebytes(s: bytes) -> bytes: ...
|
||||
def encodebytes(s: bytes) -> bytes: ...
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
import __builtin__ as builtins
|
||||
import cStringIO
|
||||
|
||||
StringIO = cStringIO.StringIO
|
||||
BytesIO = StringIO
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
import builtins as builtins
|
||||
import io
|
||||
|
||||
StringIO = io.StringIO
|
||||
BytesIO = io.BytesIO
|
||||
else:
|
||||
import __builtin__ as builtins
|
||||
import cStringIO
|
||||
|
||||
StringIO = cStringIO.StringIO
|
||||
BytesIO = StringIO
|
||||
|
||||
def byte_ord(c: Union[int, str]) -> int: ...
|
||||
def byte_chr(c: int) -> bytes: ...
|
||||
|
||||
@@ -6,10 +6,10 @@ from typing import IO, AnyStr, Callable, Generic, List, Optional, Protocol, Text
|
||||
from paramiko.config import SSHConfig, SSHConfigDict
|
||||
from paramiko.hostkeys import HostKeys
|
||||
|
||||
if sys.version_info < (3, 0):
|
||||
from hashlib import _hash as _Hash
|
||||
else:
|
||||
if sys.version_info >= (3, 0):
|
||||
from hashlib import _Hash
|
||||
else:
|
||||
from hashlib import _hash as _Hash
|
||||
|
||||
class SupportsClose(Protocol):
|
||||
def close(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user