MCPcopy
hub / github.com/Yelp/dumb-init / process_state

Function process_state

testing/__init__.py:82–86  ·  view source on GitHub ↗

Return a process' state, such as "stopped" or "running".

(pid)

Source from the content-addressed store, hash-verified

80
81
82def process_state(pid):
83 """Return a process' state, such as "stopped" or "running"."""
84 status = LocalPath('/proc').join(str(pid), 'status').read()
85 m = re.search(r'^State:\s+[A-Z] \(([a-z]+)\)$', status, re.MULTILINE)
86 return m.group(1)
87
88
89def sleep_until(fn, timeout=1.5):

Calls

no outgoing calls