MCPcopy Create free account
hub / github.com/ipython/ipython / check_pid

Function check_pid

IPython/utils/_process_cli.py:65–78  ·  view source on GitHub ↗

Check if a process with the given PID (pid) exists

(pid)

Source from the content-addressed store, hash-verified

63 return output
64
65def check_pid(pid):
66 """
67 Check if a process with the given PID (pid) exists
68 """
69 try:
70 System.Diagnostics.Process.GetProcessById(pid)
71 # process with given pid is running
72 return True
73 except System.InvalidOperationException:
74 # process wasn't started by this object (but is running)
75 return True
76 except System.ArgumentException:
77 # process with given pid isn't running
78 return False

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected