summaryrefslogtreecommitdiff
path: root/lockfile.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-12 09:06:29 -0800
committerScott <[email protected]>2022-01-12 09:06:29 -0800
commit55a3172e37855f388b9ba0dfc91641a6c9ad1376 (patch)
tree01285a4abb59103ec437375d1133f9d00caa1497 /lockfile.py
parentffc4022c1ea2c2a5892150ff55e6c9a9ddbb8756 (diff)
Scale back warnings.warn and add stacklevels= where appropriate.
Diffstat (limited to 'lockfile.py')
-rw-r--r--lockfile.py4
1 files changed, 0 insertions, 4 deletions
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