Skip to content

Commit

Permalink
yield without try-except
Browse files Browse the repository at this point in the history
  • Loading branch information
hhamana authored and tomwojcik committed Nov 26, 2022
1 parent 09d2bfe commit 7eec35a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions starlette_context/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ def request_cycle_context(
if initial_data is None:
initial_data = {}
token: Token = _request_scope_context_storage.set(initial_data.copy())
try:
yield
finally:
_request_scope_context_storage.reset(token)
yield
_request_scope_context_storage.reset(token)


from starlette_context.ctx import context # noqa: E402
Expand Down

0 comments on commit 7eec35a

Please sign in to comment.