Skip to content

Commit

Permalink
Fix incorrect datetime.UTC access
Browse files Browse the repository at this point in the history
  • Loading branch information
user202729 committed Dec 9, 2024
1 parent 16b9d2b commit 7272c74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/scripts/cysignals-CSI
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ import tempfile
import sysconfig
import site

import datetime
from argparse import ArgumentParser
from datetime import datetime
from shutil import which
import importlib.resources as importlib_resources

Expand Down Expand Up @@ -130,8 +130,8 @@ def prune_old_logs(directory, days):
"""
for filename in os.listdir(directory):
filename = os.path.join(directory, filename)
mtime = datetime.fromtimestamp(os.path.getmtime(filename), datetime.UTC)
age = datetime.now(datetime.UTC) - mtime
mtime = datetime.datetime.fromtimestamp(os.path.getmtime(filename), datetime.UTC)
age = datetime.datetime.now(datetime.UTC) - mtime
if age.days >= days:
try:
os.unlink(filename)
Expand Down

0 comments on commit 7272c74

Please sign in to comment.