mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-25 05:11:09 +08:00
Don't import enum in Python 2 stubs (#5445)
Python 2.7 doesn't have enum in the stdlib, in particular, so we shouldn't import it.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import enum
|
||||
import sys
|
||||
from typing import AnyStr, List, Optional, Text, Type, Union
|
||||
|
||||
@@ -12,6 +11,7 @@ class PyCompileError(Exception):
|
||||
def __init__(self, exc_type: Type[BaseException], exc_value: BaseException, file: str, msg: str = ...) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
import enum
|
||||
class PycInvalidationMode(enum.Enum):
|
||||
TIMESTAMP: int = ...
|
||||
CHECKED_HASH: int = ...
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
import enum
|
||||
import socket
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, Callable, ClassVar, Dict, Iterable, List, NamedTuple, Optional, Set, Text, Tuple, Type, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
import enum
|
||||
|
||||
_PCTRTT = Tuple[Tuple[str, str], ...]
|
||||
_PCTRTTT = Tuple[_PCTRTT, ...]
|
||||
_PeerCertRetDictType = Dict[str, Union[str, _PCTRTTT, _PCTRTT]]
|
||||
@@ -228,7 +230,7 @@ class _ASN1Object(NamedTuple):
|
||||
longname: str
|
||||
oid: str
|
||||
|
||||
if sys.version_info >= (3, 0):
|
||||
if sys.version_info >= (3, 4):
|
||||
class Purpose(_ASN1Object, enum.Enum):
|
||||
SERVER_AUTH: _ASN1Object
|
||||
CLIENT_AUTH: _ASN1Object
|
||||
|
||||
Reference in New Issue
Block a user