Skip to content

Commit

Permalink
Update cysignals-CSI
Browse files Browse the repository at this point in the history
fix a deprecation about datetime
  • Loading branch information
fchapoton authored Sep 13, 2024
1 parent c901dc9 commit 24d859f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/cysignals-CSI
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ def prune_old_logs(directory, days):
"""
for filename in os.listdir(directory):
filename = os.path.join(directory, filename)
mtime = datetime.utcfromtimestamp(os.path.getmtime(filename))
age = datetime.utcnow() - mtime
mtime = datetime.fromtimestamp(os.path.getmtime(filename), datetime.UTC)
age = datetime.now(datetime.UTC) - mtime
if age.days >= days:
try:
os.unlink(filename)
Expand Down

0 comments on commit 24d859f

Please sign in to comment.