Skip to content

Commit 34c3fdf

Browse files
committed
Add locals to call on exception
1 parent cef6d35 commit 34c3fdf

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/dependency_injector/providers.pxd

+6-3
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,12 @@ cdef inline object __call(
575575
asyncio.ensure_future(args_kwargs_ready)
576576

577577
return future_result
578-
579-
return call(*args, **kwargs)
580-
578+
try:
579+
return call(*args, **kwargs)
580+
except Exception as e:
581+
e.__traceback__.tb_frame.f_locals.clear()
582+
e.__traceback__.tb_frame.f_locals.update(locals())
583+
raise e
581584

582585
cdef inline void __async_call_callback(object future_result, object call, object future):
583586
try:

0 commit comments

Comments
 (0)