MCPcopy Create free account
hub / github.com/pybind/pybind11 / Thread

Class Thread

tests/test_thread.py:12–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11
12class Thread(threading.Thread):
13 def __init__(self, fn):
14 super().__init__()
15 self.fn = fn
16 self.e = None
17
18 def run(self):
19 try:
20 for i in range(10):
21 self.fn(i, i)
22 except Exception as e:
23 self.e = e
24
25 def join(self):
26 super().join()
27 if self.e:
28 raise self.e
29
30
31@pytest.mark.skipif(sys.platform.startswith("emscripten"), reason="Requires threads")

Callers 3

test_implicit_conversionFunction · 0.85

Calls

no outgoing calls

Tested by 3

test_implicit_conversionFunction · 0.68