import os
import time
+
class FileLockException(Exception):
"""FileLock Exception"""
- pass
+
class FileLock:
""" A plain file lock whit context-manager"""
while True:
try:
self.filedsc = os.open(self.lockfile,
- os.O_CREAT|os.O_EXCL|os.O_RDWR)
+ os.O_CREAT | os.O_EXCL | os.O_RDWR)
break
except OSError as err:
if err.errno != errno.EEXIST: