mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 19:01:15 +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,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