Silence warning about timezone in datetime object

Modern versions of Python emit a DeprecationWarning about
`datetime.datetime.utcfromtimestamp()`. It didn't really matter here, but do
stop using it.

Signed-off-by: Gilles Peskine <[email protected]>
This commit is contained in:
Gilles Peskine
2026-07-20 10:53:29 +02:00
parent 3ef14048e0
commit f3e151299b
+2 -1
View File
@@ -341,7 +341,8 @@ class EntryFileSortKey:
text = subprocess.check_output(['git', 'show', '-s',
'--format=%ct',
commit_id])
return datetime.datetime.utcfromtimestamp(int(text))
return datetime.datetime.fromtimestamp(int(text),
datetime.timezone.utc)
@staticmethod
def file_timestamp(filename):