Skip to content

Commit

Permalink
Add locals to tb_frame on exception
Browse files Browse the repository at this point in the history
  • Loading branch information
gen-xu committed Sep 15, 2021
1 parent cef6d35 commit 4de3fa7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/dependency_injector/providers.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -575,9 +575,12 @@ cdef inline object __call(
asyncio.ensure_future(args_kwargs_ready)

return future_result

return call(*args, **kwargs)

try:
return call(*args, **kwargs)
except Exception as e:
e.__traceback__.tb_frame.f_locals.clear()
e.__traceback__.tb_frame.f_locals.update(locals())
raise e

cdef inline void __async_call_callback(object future_result, object call, object future):
try:
Expand Down

0 comments on commit 4de3fa7

Please sign in to comment.