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,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 = ...