Replace deprecated datetime.utcnow()
The datetime.utcnow() is deprecated in Python 3.12. Replace datetime.utcnow() with datetime.now(datetime.timezone.utc).replace(tzinfo=None). Change-Id: I9bf6f69d9e174d490bb4f3eaef3b364ddf97a954 Signed-off-by: Takashi Natsume <takanattie@gmail.com>
This commit is contained in:
parent
29545a5109
commit
50b0b60227
@ -76,7 +76,8 @@ def main():
|
||||
# with zuulv3 native jobs and ansible capture it may become
|
||||
# clearer what to do
|
||||
if HAS_DATE.search(line) is None:
|
||||
now = datetime.datetime.utcnow()
|
||||
now = datetime.datetime.now(datetime.timezone.utc).replace(
|
||||
tzinfo=None)
|
||||
ts_line = ("%s | %s" % (
|
||||
now.strftime("%Y-%m-%d %H:%M:%S.%f")[:-3],
|
||||
line))
|
||||
|
Loading…
Reference in New Issue
Block a user