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

Function kill_on_error

Lib/test/test_remote_pdb.py:27–34  ·  view source on GitHub ↗

Context manager killing the subprocess if a Python exception is raised.

(proc)

Source from the content-addressed store, hash-verified

25
26@contextmanager
27def kill_on_error(proc):
28 """Context manager killing the subprocess if a Python exception is raised."""
29 with proc:
30 try:
31 yield proc
32 except:
33 proc.kill()
34 raise
35
36
37class MockSocketFile:

Calls 1

killMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…