Skip to content

Commit

Permalink
fix: 修复python部分异步接口不返回的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Mar 11, 2024
1 parent fd3bbfd commit b0aca81
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion source/binding/Python/maa/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def connect(self) -> bool:
:return: True if the connection was successful, False otherwise.
"""
await self.post_connection().wait()
return await self.post_connection().wait()

def post_connection(self) -> Future:
"""
Expand Down
4 changes: 2 additions & 2 deletions source/binding/Python/maa/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async def run_task(self, task_type: str, param: Dict = {}) -> bool:
:return: True if the task was successfully run, False otherwise.
"""

await self.post_task(task_type, param).wait()
return await self.post_task(task_type, param).wait()

def post_task(self, task_type: str, param: Any = {}) -> Future:
"""
Expand Down Expand Up @@ -119,7 +119,7 @@ async def stop(self) -> bool:
:return: True if all tasks were successfully stopped, False otherwise.
"""

await self.post_stop().wait()
return await self.post_stop().wait()

def post_stop(self) -> Future:
"""
Expand Down
2 changes: 1 addition & 1 deletion source/binding/Python/maa/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ async def load(self, path: Union[pathlib.Path, str]) -> bool:
:return: True if the resource was successfully loaded, False otherwise.
"""

await self.post_path(path).wait()
return await self.post_path(path).wait()

def post_path(self, path: Union[pathlib.Path, str]) -> Future:
"""
Expand Down

0 comments on commit b0aca81

Please sign in to comment.