Skip to content

Commit 0ca7e74

Browse files
committed
StrEnum polyfill
1 parent ae9e557 commit 0ca7e74

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/python/async_tiff/enums.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
from enum import IntEnum, StrEnum
1+
import sys
2+
from enum import IntEnum
3+
4+
if sys.version_info >= (3, 11):
5+
from enum import StrEnum
6+
else:
7+
from enum import Enum
8+
class StrEnum(str, Enum):
9+
def __str__(self):
10+
return str(self.value)
211

312
class Endianness(StrEnum):
413
"""

0 commit comments

Comments
 (0)