Skip to content

Commit 49d86d7

Browse files
authored
Raise without argument, reraise the current exception
1 parent 33d9e2d commit 49d86d7

File tree

5 files changed

+170
-177
lines changed

5 files changed

+170
-177
lines changed

.github/actions/environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ runs:
1010
using: "composite"
1111
steps:
1212
- name: Install UV
13-
uses: astral-sh/setup-uv@v5
13+
uses: astral-sh/setup-uv@v6
1414
with:
1515
python-version: ${{ inputs.python-version }}
1616

cq/_core/message.py

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,18 @@
3333
)
3434

3535

36-
@injection.singleton(
37-
on=CommandBus,
38-
ignore_type_hint=True, # type: ignore[call-arg]
39-
inject=False,
40-
mode="fallback",
41-
)
42-
def new_command_bus[T]() -> CommandBus[T]:
36+
@injection.singleton(inject=False, mode="fallback")
37+
def new_command_bus() -> CommandBus: # type: ignore[type-arg]
4338
bus = SimpleBus(command_handler.manager)
4439
bus.add_middlewares(InjectionScopeMiddleware(CQScope.ON_COMMAND))
4540
return bus
4641

4742

48-
@injection.singleton(
49-
inject=False,
50-
mode="fallback",
51-
)
43+
@injection.singleton(inject=False, mode="fallback")
5244
def new_event_bus() -> EventBus:
5345
return TaskBus(event_handler.manager)
5446

5547

56-
@injection.singleton(
57-
on=QueryBus,
58-
ignore_type_hint=True, # type: ignore[call-arg]
59-
inject=False,
60-
mode="fallback",
61-
)
62-
def new_query_bus[T]() -> QueryBus[T]:
48+
@injection.singleton(inject=False, mode="fallback")
49+
def new_query_bus() -> QueryBus: # type: ignore[type-arg]
6350
return SimpleBus(query_handler.manager)

cq/middlewares/retry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ async def __call__(self, *args: Any, **kwargs: Any) -> MiddlewareResult[Any]:
3232
try:
3333
yield
3434

35-
except self.__exceptions as exc:
35+
except self.__exceptions:
3636
if attempt == retry:
37-
raise exc
37+
raise
3838

3939
else:
4040
break

tests/helpers/history.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ async def __call__(self, /, *args: Any, **kwargs: Any) -> MiddlewareResult[Any]:
3838
result = yield
3939
except BaseException as exc:
4040
record = HistoryRecord(args, kwargs, exc, HistoryRecordStatus.FAILED)
41-
raise exc
41+
raise
4242
else:
4343
record = HistoryRecord(args, kwargs, result, HistoryRecordStatus.SUCCESS)
4444
finally:

0 commit comments

Comments
 (0)