Skip to content

Commit ff2daae

Browse files
committed
Changed back to getmtime
1 parent 1f0ffbe commit ff2daae

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/idpyoidc/storage/listfile.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import logging
22
import os
3-
from pathlib import Path
43
import time
54

65
from filelock import FileLock
@@ -40,14 +39,13 @@ def get_mtime(fname):
4039
:param fname: File name
4140
:return: The last time the file was modified.
4241
"""
43-
p = Path(fname)
4442
try:
45-
mtime = p.stat().st_mtime
43+
mtime = os.path.getmtime(fname)
4644
except OSError:
4745
# The file might be right in the middle of being created
4846
# so sleep
4947
time.sleep(1)
50-
mtime = p.stat().st_mtime
48+
mtime = os.path.getmtime(fname)
5149

5250
return mtime
5351

@@ -65,7 +63,7 @@ def is_changed(self, fname):
6563
self.fmtime = mtime
6664
return True
6765

68-
if mtime > self.fmtime: # has changed
66+
if mtime != self.fmtime: # has changed
6967
self.fmtime = mtime
7068
return True
7169
else:

0 commit comments

Comments
 (0)