mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
[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.
This commit is contained in:
parent
23ad9f4bc0
commit
dcdd16038b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user