From: Andreas Schneider Date: Mon, 1 Feb 2021 09:38:08 +0000 (+0100) Subject: python:subunit: Use UTC timezone from datatime module X-Git-Tag: tevent-0.11.0~1848 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=30450bff66982eb7295d7a00be42052cbd6ad596;p=thirdparty%2Fsamba.git python:subunit: Use UTC timezone from datatime module Signed-off-by: Andreas Schneider Reviewed-by: Alexander Bokovoy --- diff --git a/python/samba/subunit/run.py b/python/samba/subunit/run.py index e369b15aa02..45425e6c2e6 100755 --- a/python/samba/subunit/run.py +++ b/python/samba/subunit/run.py @@ -24,8 +24,6 @@ $ python -m samba.subunit.run mylib.tests.test_suite """ -from iso8601.iso8601 import UTC - import datetime import os import sys @@ -184,7 +182,7 @@ class TestProtocolClient(unittest.TestResult): ":param datetime: A datetime.datetime object. """ - time = a_datetime.astimezone(UTC) + time = a_datetime.astimezone(datetime.timezone.utc) self._stream.write("time: %04d-%02d-%02d %02d:%02d:%02d.%06dZ\n" % ( time.year, time.month, time.day, time.hour, time.minute, time.second, time.microsecond)) @@ -458,7 +456,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator): time = self._time if time is not None: return - time = datetime.datetime.utcnow().replace(tzinfo=UTC) + time = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc) self.decorated.time(time) @property