##// END OF EJS Templates
Add .NET implementation of check_pid
Amin Bandali -
Show More
@@ -61,3 +61,13 b' def getoutput(cmd):'
61 myError = reg.StandardError
61 myError = reg.StandardError
62 error = myError.ReadToEnd()
62 error = myError.ReadToEnd()
63 return output
63 return output
64
65 def 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 return True
72 except System.ArgumentException:
73 return False
@@ -23,7 +23,7 b' import sys'
23 if sys.platform == 'win32':
23 if sys.platform == 'win32':
24 from ._process_win32 import _find_cmd, system, getoutput, arg_split, check_pid
24 from ._process_win32 import _find_cmd, system, getoutput, arg_split, check_pid
25 elif sys.platform == 'cli':
25 elif sys.platform == 'cli':
26 from ._process_cli import _find_cmd, system, getoutput, arg_split
26 from ._process_cli import _find_cmd, system, getoutput, arg_split, check_pid
27 else:
27 else:
28 from ._process_posix import _find_cmd, system, getoutput, arg_split, check_pid
28 from ._process_posix import _find_cmd, system, getoutput, arg_split, check_pid
29
29
General Comments 0
You need to be logged in to leave comments. Login now