File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
2
import os
3
- from pathlib import Path
4
3
import time
5
4
6
5
from filelock import FileLock
@@ -40,14 +39,13 @@ def get_mtime(fname):
40
39
:param fname: File name
41
40
:return: The last time the file was modified.
42
41
"""
43
- p = Path (fname )
44
42
try :
45
- mtime = p . stat (). st_mtime
43
+ mtime = os . path . getmtime ( fname )
46
44
except OSError :
47
45
# The file might be right in the middle of being created
48
46
# so sleep
49
47
time .sleep (1 )
50
- mtime = p . stat (). st_mtime
48
+ mtime = os . path . getmtime ( fname )
51
49
52
50
return mtime
53
51
@@ -65,7 +63,7 @@ def is_changed(self, fname):
65
63
self .fmtime = mtime
66
64
return True
67
65
68
- if mtime > self .fmtime : # has changed
66
+ if mtime != self .fmtime : # has changed
69
67
self .fmtime = mtime
70
68
return True
71
69
else :
You can’t perform that action at this time.
0 commit comments