From 3dd3f045e6db16f5ba24efb70d34af61740f9205 Mon Sep 17 00:00:00 2001 From: Berserker66 Date: Sun, 29 May 2022 07:43:53 +0000 Subject: [PATCH] WebHost: use non-blocking file lock on unix, just like windows --- WebHostLib/autolauncher.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebHostLib/autolauncher.py b/WebHostLib/autolauncher.py index 97db4ca6..dc88c202 100644 --- a/WebHostLib/autolauncher.py +++ b/WebHostLib/autolauncher.py @@ -53,7 +53,7 @@ else: # unix def __enter__(self): try: self.fp = open(self.lockfile, "wb") - fcntl.flock(self.fp.fileno(), fcntl.LOCK_EX) + fcntl.flock(self.fp.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB) except OSError as e: raise AlreadyRunningException() from e