Skip to content

Commit ebd802a

Browse files
authored
Merge pull request #214 from user202729/datetime-utc
Fix incorrect datetime.UTC access
2 parents cdbf764 + 7272c74 commit ebd802a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/scripts/cysignals-CSI

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ import tempfile
3737
import sysconfig
3838
import site
3939

40+
import datetime
4041
from argparse import ArgumentParser
41-
from datetime import datetime
4242
from shutil import which
4343
import importlib.resources as importlib_resources
4444

@@ -130,8 +130,8 @@ def prune_old_logs(directory, days):
130130
"""
131131
for filename in os.listdir(directory):
132132
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
135135
if age.days >= days:
136136
try:
137137
os.unlink(filename)

0 commit comments

Comments
 (0)