mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user