Skip to content

Commit

Permalink
fix: Enum with str or int Mixin Breaking Change in Python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
taro-kayo committed May 27, 2023
1 parent 2010ba0 commit 0ce5d2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions statelint/fields/common.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import json
from enum import Enum
from enum import StrEnum
from typing import Any


class Comparison(str, Enum):
class Comparison(StrEnum):
STRING_EQUALS = "StringEquals"
STRING_LESS_THAN = "StringLessThan"
STRING_GREATER_THAN = "StringGreaterThan"
Expand Down Expand Up @@ -45,7 +45,7 @@ class Comparison(str, Enum):
STRING_MATCHES = "StringMatches"


class StateType(str, Enum):
class StateType(StrEnum):
PASS = "Pass"
SUCCEED = "Succeed"
FAIL = "Fail"
Expand Down
4 changes: 2 additions & 2 deletions statelint/problem/problem_type.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from enum import Enum
from enum import StrEnum


class ProblemType(str, Enum):
class ProblemType(StrEnum):
# type check
FLOAT = "a Float"
STRING = "a String"
Expand Down

0 comments on commit 0ce5d2e

Please sign in to comment.