Skip to content

Commit

Permalink
callers: do .close() also in the throw case
Browse files Browse the repository at this point in the history
No reason to not do it also for exceptions. Was a thinko.
  • Loading branch information
bluetech committed Jun 17, 2023
1 parent 40fbab1 commit efe096a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pluggy/_callers.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ def _multicall(
teardown.throw(outcome._exception)
else:
teardown.send(outcome._result)
# Following is unreachable for a well behaved hook wrapper.
# Try to force finalizers otherwise postponed till GC action.
# Note: close() may raise if generator handles GeneratorExit.
teardown.close()
# Following is unreachable for a well behaved hook wrapper.
# Try to force finalizers otherwise postponed till GC action.
# Note: close() may raise if generator handles GeneratorExit.
teardown.close()
except StopIteration as si:
outcome.force_result(si.value)
continue
Expand Down

0 comments on commit efe096a

Please sign in to comment.