|
@@ -20,7 +20,10 @@ def kill():
|
|
if python_path and project_path:
|
|
if python_path and project_path:
|
|
pid_list = psutil.pids()
|
|
pid_list = psutil.pids()
|
|
for pid in pid_list:
|
|
for pid in pid_list:
|
|
- process = psutil.Process(pid)
|
|
|
|
|
|
+ try:
|
|
|
|
+ process = psutil.Process(pid)
|
|
|
|
+ except:
|
|
|
|
+ continue
|
|
process_cmd = ''
|
|
process_cmd = ''
|
|
for c in process.cmdline():
|
|
for c in process.cmdline():
|
|
process_cmd += c + " "
|
|
process_cmd += c + " "
|
|
@@ -32,10 +35,8 @@ def kill():
|
|
if re.search(project_path, process_cmd):
|
|
if re.search(project_path, process_cmd):
|
|
comm = "kill -9 " + str(pid)
|
|
comm = "kill -9 " + str(pid)
|
|
print(comm, process_cmd)
|
|
print(comm, process_cmd)
|
|
- try:
|
|
|
|
- os.system(comm)
|
|
|
|
- except:
|
|
|
|
- continue
|
|
|
|
|
|
+ os.system(comm)
|
|
|
|
+
|
|
else:
|
|
else:
|
|
print("cannot kill! checkout config...")
|
|
print("cannot kill! checkout config...")
|
|
print(ip_port_dict)
|
|
print(ip_port_dict)
|