]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python:subunit: Use now() instead of utcnow()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 2 Oct 2023 00:57:43 +0000 (13:57 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 03:50:31 +0000 (03:50 +0000)
utcnow() is deprecated and will be removed in a future version of Python.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/subunit/run.py

index 7881db448a855abcefbcdfb984e132ad690b8a4e..4cf42b05eaf12ac948c39c19875241462735607c 100755 (executable)
@@ -436,7 +436,7 @@ class AutoTimingTestResultDecorator(HookedTestResultDecorator):
         time = self._time
         if time is not None:
             return
-        time = datetime.datetime.utcnow().replace(tzinfo=datetime.timezone.utc)
+        time = datetime.datetime.now(tz=datetime.timezone.utc)
         self.decorated.time(time)
 
     @property