Skip to content

Commit f2cb6b1

Browse files
committed
use EnumMeta for python < 3.11
1 parent 4b55b7f commit f2cb6b1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chia/util/streamable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pprint
99
import traceback
1010
from collections.abc import Collection
11-
from enum import Enum, EnumType
11+
from enum import Enum, EnumMeta
1212
from typing import TYPE_CHECKING, Any, BinaryIO, Callable, ClassVar, Optional, TypeVar, Union, get_type_hints
1313

1414
from chia_rs.sized_bytes import bytes32
@@ -131,7 +131,7 @@ def is_type_Dict(f_type: object) -> bool:
131131

132132

133133
def is_type_Enum(f_type: object) -> bool:
134-
return type(f_type) is EnumType
134+
return type(f_type) is EnumMeta
135135

136136

137137
def convert_optional(convert_func: ConvertFunctionType, item: Any) -> Any:
@@ -727,7 +727,7 @@ class UInt64Range(Streamable):
727727
stop: uint64 = uint64.MAXIMUM
728728

729729

730-
_T_Enum = TypeVar("_T_Enum", bound=EnumType)
730+
_T_Enum = TypeVar("_T_Enum", bound=EnumMeta)
731731

732732

733733
def streamable_enum(proxy: type[Any]) -> Callable[[_T_Enum], _T_Enum]:

0 commit comments

Comments
 (0)