Skip to content

Commit 9c7246f

Browse files
author
Tyler Goodlet
committed
Simplify outcome generation
Avoids forcing a result with `firstresult` hooks. Thanks to @RonnyPfannschmidt for the nice simplification.
1 parent dc1d67d commit 9c7246f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pluggy/callers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,10 @@ def execute(self):
9696
except BaseException:
9797
excinfo = sys.exc_info()
9898
finally:
99-
outcome = _Result(results, excinfo)
10099
if firstresult: # first result hooks return a single value
101-
results = outcome.get_result()
102-
result = results[0] if results else None
103-
outcome.force_result(result)
100+
outcome = _Result(results[0] if results else None, excinfo)
101+
else:
102+
outcome = _Result(results, excinfo)
104103

105104
# run all wrapper post-yield blocks
106105
for gen in reversed(teardowns):

0 commit comments

Comments
 (0)