X-Git-Url: https://wannabe.guru.org/gitweb/?a=blobdiff_plain;f=lockfile.py;h=8a71ca769900983689479157de0cb3132ab731a9;hb=55a3172e37855f388b9ba0dfc91641a6c9ad1376;hp=7f10cc1f5894155c65ca352183afc0ea6d81fa37;hpb=ffc4022c1ea2c2a5892150ff55e6c9a9ddbb8756;p=python_utils.git diff --git a/lockfile.py b/lockfile.py index 7f10cc1..8a71ca7 100644 --- a/lockfile.py +++ b/lockfile.py @@ -90,7 +90,6 @@ class LockFile(object): pass msg = f'Could not acquire {self.lockfile}.' logger.warning(msg) - warnings.warn(msg) return False def acquire_with_retries( @@ -127,7 +126,6 @@ class LockFile(object): return self msg = f"Couldn't acquire {self.lockfile}; giving up." logger.warning(msg) - warnings.warn(msg) raise LockFileException(msg) def __exit__(self, type, value, traceback): @@ -178,7 +176,6 @@ class LockFile(object): except OSError: msg = f'Lockfile {self.lockfile}\'s pid ({contents.pid}) is stale; force acquiring' logger.warning(msg) - warnings.warn(msg) self.release() # Has the lock expiration expired? @@ -187,7 +184,6 @@ class LockFile(object): if now > contents.expiration_datetime: msg = f'Lockfile {self.lockfile} expiration time has passed; force acquiring' logger.warning(msg) - warnings.warn(msg) self.release() except Exception: pass