From af01f1f4be493ae68249bedcd627285f08e3d6f7 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Sat, 16 May 2020 16:32:07 -0700 Subject: [PATCH] uuid: import enum inside version check. (#4009) Otherwise, pytype tries to import enum in Python 2 and complains that the library doesn't exist. --- stdlib/2and3/uuid.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/2and3/uuid.pyi b/stdlib/2and3/uuid.pyi index cfdcc1ebd..19b807edc 100644 --- a/stdlib/2and3/uuid.pyi +++ b/stdlib/2and3/uuid.pyi @@ -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