uuid: import enum inside version check. (#4009)

Otherwise, pytype tries to import enum in Python 2 and complains that
the library doesn't exist.
This commit is contained in:
Rebecca Chen
2020-05-16 16:32:07 -07:00
committed by GitHub
parent 0a69743bca
commit af01f1f4be

View File

@@ -1,7 +1,6 @@
# Stubs for uuid
import sys
from enum import Enum
from typing import Tuple, Optional, Any, Text
# Because UUID has properties called int and bytes we need to rename these temporarily.
@@ -10,6 +9,7 @@ _Bytes = bytes
_FieldsType = Tuple[int, int, int, int, int, int]
if sys.version_info >= (3, 7):
from enum import Enum
class SafeUUID(Enum):
safe: int
unsafe: int