From 2b1d5ea0c256815bfdce6310c6b65eb8248baa9f Mon Sep 17 00:00:00 2001 From: Vasileios Karakasis Date: Mon, 4 Dec 2023 22:03:22 +0100 Subject: [PATCH] Remove use of deprecated "%Z" directive in `strftime()` --- reframe/frontend/printer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/reframe/frontend/printer.py b/reframe/frontend/printer.py index be71c6d089..a986646869 100644 --- a/reframe/frontend/printer.py +++ b/reframe/frontend/printer.py @@ -3,8 +3,7 @@ # # SPDX-License-Identifier: BSD-3-Clause -import datetime - +import time import reframe.core.logging as logging import reframe.utility.color as color @@ -68,7 +67,7 @@ def status(self, status, message='', just=None, level=logging.INFO): logging.getlogger().log(level, final_msg) def timestamp(self, msg='', separator=None): - msg = '%s %s' % (msg, datetime.datetime.today().strftime('%c %Z')) + msg = f'{msg} {time.strftime("%c%z")}' if separator: self.separator(separator, msg) else: