Skip to content

Commit

Permalink
fix: exec_result, 0.23.5
Browse files Browse the repository at this point in the history
  • Loading branch information
RF-Tar-Railt committed Jan 10, 2024
1 parent ee586c8 commit 0adb9f4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ dependencies = [
"creart~=0.3.0",
]
name = "graia-broadcast"
version = "0.23.4"
version = "0.23.5"
description = "a highly customizable, elegantly designed event system based on asyncio"

[tool.pdm.build]
Expand Down
9 changes: 6 additions & 3 deletions src/graia/broadcast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,13 @@ async def Executor(
i = getattr(dispatcher, "afterDispatch", None)
if i:
await run_always_await(i, dii, None, None)

dii.exec_result.set_result(await run_always_await(target_callable, **parameter_compile_result))
except (ExecutionStop, PropagationCancelled):
result = await run_always_await(target_callable, **parameter_compile_result)
dii.exec_result.set_result(result)
except (ExecutionStop, PropagationCancelled) as e:
dii.exec_result.set_result(e)
raise
except RequirementCrashed as e:
dii.exec_result.set_exception(e)
if depth != 0:
if not hasattr(e, "__target__"):
e.__target__ = target_callable
Expand All @@ -211,6 +213,7 @@ async def Executor(
)
raise
except Exception as e:
dii.exec_result.set_exception(e)
if depth != 0:
raise
event: Optional[Dispatchable] = self.event_ctx.get()
Expand Down

0 comments on commit 0adb9f4

Please sign in to comment.