--- a/svghmi/svghmi_server.py Mon Oct 09 16:42:11 2023 +0200
+++ b/svghmi/svghmi_server.py Mon Oct 09 16:42:59 2023 +0200
@@ -307,15 +307,15 @@
def waitpid_timeout(proc, helpstr="", timeout = 3):
if proc is None:
return
- def waitpid_timeout_loop(pid=proc.pid, timeout = timeout):
+ def waitpid_timeout_loop(proc = proc, timeout = timeout):
try:
- while os.waitpid(pid,os.WNOHANG) == (0,0):
+ while proc.poll() is None:
time.sleep(1)
timeout = timeout - 1
if not timeout:
GetPLCObjectSingleton().LogMessage(
LogLevelsDict["WARNING"],
- "Timeout waiting for {} PID: {}".format(helpstr, str(pid)))
+ "Timeout waiting for {} PID: {}".format(helpstr, str(proc.pid)))
break
except OSError:
# workaround exception "OSError: [Errno 10] No child processes"