瀏覽代碼

solve restart error on windows (#583)

PeterYusuke 2 年之前
父節點
當前提交
1204aa8a26
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      pynecone/utils.py

+ 2 - 1
pynecone/utils.py

@@ -716,7 +716,8 @@ def kill_process_on_port(port):
         port: The port.
     """
     if get_process_on_port(port) is not None:
-        get_process_on_port(port).kill()  # type: ignore
+        with contextlib.suppress(psutil.AccessDenied):
+            get_process_on_port(port).kill()  # type: ignore
 
 
 def change_or_terminate_port(port, _type) -> str: