]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:subunit: Use UTC timezone from datatime module
authorAndreas Schneider <asn@samba.org>
Mon, 1 Feb 2021 09:38:08 +0000 (10:38 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Tue, 2 Feb 2021 18:48:35 +0000 (18:48 +0000)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
python/samba/subunit/run.py

index e369b15aa023c86caf045f1de18892032b93754f..45425e6c2e680d3bbcb48b62aef0258acd8efd7f 100755 (executable)
@@ -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