From 5bd83e9c49e9a81c3b49907f309ffc9d267c752f Mon Sep 17 00:00:00 2001 From: Kyr Shatskyy Date: Mon, 5 Aug 2024 01:15:24 +0200 Subject: [PATCH] timer: use datetime.timezone.utc for python 3.10 Python 3.10 doesn't have datetime.UTC yet as Python 3.12 does Signed-off-by: Kyr Shatskyy --- teuthology/timer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/teuthology/timer.py b/teuthology/timer.py index 3d8eb7733..9ca5d76a7 100644 --- a/teuthology/timer.py +++ b/teuthology/timer.py @@ -68,7 +68,7 @@ def get_datetime_string(self, time): :param time: Time in seconds; like from time.time() """ - _datetime = datetime.datetime.fromtimestamp(time, datetime.UTC) + _datetime = datetime.datetime.fromtimestamp(time, datetime.timezone.utc) return datetime.datetime.strftime( _datetime, self.datetime_format,