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:
Jukka Lehtosalo
2021-05-14 14:29:54 +01:00
committed by GitHub
parent 322396bb32
commit 17bc1d83ea
2 changed files with 5 additions and 3 deletions

View File

@@ -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