Skip to content

Commit 54d4415

Browse files
committed
Fixed exc-propogation to be backward compatible.
Signed-off-by: Pavel Kirilin <win10@list.ru>
1 parent c71aaff commit 54d4415

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

taskiq_dependencies/ctx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def close(self, *args: Any) -> None: # noqa: C901
133133
:param args: exception info if any.
134134
"""
135135
exception_found = False
136-
if args[1] is not None and self.propagate_excs:
136+
if self.propagate_excs and len(args) > 1 and args[1] is not None:
137137
exception_found = True
138138
for ctx in self.sub_contexts:
139139
ctx.close(*args)
@@ -234,7 +234,7 @@ async def close(self, *args: Any) -> None: # noqa: C901
234234
:param args: exception info if any.
235235
"""
236236
exception_found = False
237-
if args[1] is not None and self.propagate_excs:
237+
if self.propagate_excs and len(args) > 1 and args[1] is not None:
238238
exception_found = True
239239
for ctx in self.sub_contexts:
240240
await ctx.close(*args) # type: ignore

0 commit comments

Comments
 (0)