Skip to content

Commit 4abb772

Browse files
committed
Simplify loop
1 parent a75d517 commit 4abb772

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

pytest_sentry/hooks.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,7 @@ def _with_isolation_scope(wrapped, instance, args, kwargs):
3636
else:
3737
with sentry_sdk.use_isolation_scope(isolation_scope):
3838
gen = wrapped(*args, **kwargs)
39-
40-
while True:
41-
try:
42-
chunk = next(gen)
43-
y = yield chunk
44-
gen.send(y)
45-
except StopIteration:
46-
break
39+
yield from gen
4740

4841
def inner(f):
4942
return pytest.hookimpl(hookwrapper=True, **kwargs)(_with_isolation_scope(f))

0 commit comments

Comments
 (0)