Skip to content

Commit 0de869e

Browse files
author
Tyler Goodlet
committed
Handle gen exit properly
1 parent e6d7bd5 commit 0de869e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pluggy/callers.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,8 @@ def _itercall(hook_impls, caller_kwargs, specopts={}, hook=None):
241241
yield res
242242
if firstresult: # halt further impl calls
243243
break
244+
except GeneratorExit:
245+
pass # loop was terminated prematurely by caller
244246
except BaseException:
245247
excinfo = sys.exc_info()
246248
finally:

0 commit comments

Comments
 (0)