MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / clean_process

Function clean_process

test/test_sockets.py:78–90  ·  view source on GitHub ↗
(p)

Source from the content-addressed store, hash-verified

76
77
78def clean_process(p):
79 if getattr(p, 'exitcode', None) is None and getattr(p, 'returncode', None) is None:
80 # ask nicely (to try and catch the children)
81 try:
82 p.terminate() # SIGTERM
83 except OSError:
84 pass
85 time.sleep(1)
86 # send a forcible kill immediately afterwards. If the process did not die before, this should clean it.
87 try:
88 p.terminate() # SIGKILL
89 except OSError:
90 pass
91
92
93class WebsockifyServerHarness:

Callers 3

clean_processesMethod · 0.85
__exit__Method · 0.85
__exit__Method · 0.85

Calls 3

sleepMethod · 0.80
getattrFunction · 0.50
terminateMethod · 0.45

Tested by

no test coverage detected