]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
timer: use datetime.timezone.utc for python 3.10 1992/head
authorKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Sun, 4 Aug 2024 23:15:24 +0000 (01:15 +0200)
committerKyr Shatskyy <kyrylo.shatskyy@clyso.com>
Sun, 4 Aug 2024 23:15:24 +0000 (01:15 +0200)
Python 3.10 doesn't have datetime.UTC yet as Python 3.12 does

Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@clyso.com>
teuthology/timer.py

index 3d8eb7733949150358d08b936dd26d808e0b8078..9ca5d76a7166528b1357e6cad34010f5c9cc321c 100644 (file)
@@ -68,7 +68,7 @@ class Timer(object):
 
         :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,