浏览代码

add try-catch in kill_all.py

fangjiasheng 2 年之前
父节点
当前提交
349554dacc
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      format_convert/kill_all.py

+ 4 - 1
format_convert/kill_all.py

@@ -32,7 +32,10 @@ def kill():
             if re.search(project_path, process_cmd):
                 comm = "kill -9 " + str(pid)
                 print(comm, process_cmd)
-                os.system(comm)
+                try:
+                    os.system(comm)
+                except:
+                    continue
     else:
         print("cannot kill! checkout config...")
         print(ip_port_dict)