Skip to content

Commit 777e30a

Browse files
committed
fix test_stop_iteration_only_local to work on Python 3.7
1 parent 47fceb5 commit 777e30a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

effect/test_do.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,13 @@ def f():
161161
yield Effect(Constant('foo'))
162162

163163
eff = f()
164-
with raises(StopIteration):
165-
perf(eff)
164+
if sys.version_info > (3, 7):
165+
# In Python 3.7, generators straight up aren't allowed to raise StopIteration any more
166+
with raises(RuntimeError):
167+
perf(eff)
168+
else:
169+
with raises(StopIteration):
170+
perf(eff)
166171

167172

168173
@mark.skipif(not six.PY3, reason="Testing a Py3-specific feature")

0 commit comments

Comments
 (0)