From dcdd16038b88ec2fee551ba756dcbb63c924ba41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mois=C3=A9s=20L=C3=B3pez?= Date: Tue, 27 Mar 2018 10:32:26 -0600 Subject: [PATCH] [REF] runbot: Remove used variable before assigned When the lock file creation fails, the file descriptor is not assigned. Before this commit, an ValueError was raised in such a situation. --- runbot/common.py | 1 - 1 file changed, 1 deletion(-) diff --git a/runbot/common.py b/runbot/common.py index c0691784..b1525a36 100644 --- a/runbot/common.py +++ b/runbot/common.py @@ -46,7 +46,6 @@ def locked(filename): try: fd = os.open(filename, os.O_CREAT | os.O_RDWR, 0o600) except OSError: - os.close(fd) return False try: fcntl.lockf(fd, fcntl.LOCK_EX | fcntl.LOCK_NB)