Commit c7837235 authored by Michal Čihař's avatar Michal Čihař

Fix some other coding style issues

parent f675a3cf
...@@ -39,9 +39,9 @@ class FileLock(object): ...@@ -39,9 +39,9 @@ class FileLock(object):
start_time = time.time() start_time = time.time()
while True: while True:
try: try:
self.fd = os.open( self.handle = os.open(
self.lockfile, self.lockfile,
os.O_CREAT|os.O_EXCL|os.O_RDWR os.O_CREAT | os.O_EXCL | os.O_RDWR
) )
break break
except OSError as e: except OSError as e:
...@@ -59,7 +59,7 @@ class FileLock(object): ...@@ -59,7 +59,7 @@ class FileLock(object):
called at the end. called at the end.
""" """
if self.is_locked: if self.is_locked:
os.close(self.fd) os.close(self.handle)
os.unlink(self.lockfile) os.unlink(self.lockfile)
self.is_locked = False self.is_locked = False
...@@ -72,7 +72,7 @@ class FileLock(object): ...@@ -72,7 +72,7 @@ class FileLock(object):
self.acquire() self.acquire()
return self return self
def __exit__(self, type, value, traceback): def __exit__(self, typ, value, traceback):
""" """
Activated at the end of the with statement. Activated at the end of the with statement.
It automatically releases the lock if it isn't locked. It automatically releases the lock if it isn't locked.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment