Skip to content

Commit

Permalink
fix(python): convert status type again
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Oct 22, 2024
1 parent b7c040a commit 02fbf89
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions source/binding/Python/maa/define.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,13 @@ class MaaCustomControllerCallbacks(ctypes.Structure):
class Status:
_status: MaaStatusEnum

def __init__(self, status: Union[MaaStatus, MaaStatusEnum]):
self._status = MaaStatusEnum(int(status))
def __init__(self, status: Union[MaaStatus, MaaStatusEnum, int]):
if isinstance(status, MaaStatus):
self._status = MaaStatusEnum(status.value)
elif isinstance(status, MaaStatusEnum):
self._status = status
else:
self._status = MaaStatusEnum(status)

@property
def done(self) -> bool:
Expand Down

0 comments on commit 02fbf89

Please sign in to comment.