File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -37,8 +37,8 @@ import tempfile
37
37
import sysconfig
38
38
import site
39
39
40
+ import datetime
40
41
from argparse import ArgumentParser
41
- from datetime import datetime
42
42
from shutil import which
43
43
import importlib .resources as importlib_resources
44
44
@@ -130,8 +130,8 @@ def prune_old_logs(directory, days):
130
130
"""
131
131
for filename in os .listdir (directory ):
132
132
filename = os .path .join (directory , filename )
133
- mtime = datetime .fromtimestamp (os .path .getmtime (filename ), datetime .UTC )
134
- age = datetime .now (datetime .UTC ) - mtime
133
+ mtime = datetime .datetime . fromtimestamp (os .path .getmtime (filename ), datetime .UTC )
134
+ age = datetime .datetime . now (datetime .UTC ) - mtime
135
135
if age .days >= days :
136
136
try :
137
137
os .unlink (filename )
You can’t perform that action at this time.
0 commit comments