MCPcopy Index your code
hub / github.com/python/cpython / exception_throwing_generator

Function exception_throwing_generator

Lib/test/_test_multiprocessing.py:2895–2901  ·  view source on GitHub ↗
(total, when)

Source from the content-addressed store, hash-verified

2893class SayWhenError(ValueError): pass
2894
2895def exception_throwing_generator(total, when):
2896 if when == -1:
2897 raise SayWhenError("Somebody said when")
2898 for i in range(total):
2899 if i == when:
2900 raise SayWhenError("Somebody said when")
2901 yield i
2902
2903
2904class _TestPool(BaseTestCase):

Calls 1

SayWhenErrorClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…