From 8a7eb400097304fd3f6335e4d8b82324e15cf8f5 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Wed, 21 Dec 2022 12:08:43 +1100 Subject: [PATCH] logging: Simplify check for strftime. Only needs to be checked at the call site. Signed-off-by: Jim Mussared --- python-stdlib/logging/logging.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python-stdlib/logging/logging.py b/python-stdlib/logging/logging.py index 7ea1c4ce..1a566847 100644 --- a/python-stdlib/logging/logging.py +++ b/python-stdlib/logging/logging.py @@ -3,9 +3,6 @@ from micropython import const import sys import time -if hasattr(time, "strftime"): - from time import strftime - CRITICAL = const(50) ERROR = const(40) WARNING = const(30) @@ -92,7 +89,7 @@ class Formatter: def formatTime(self, datefmt, record): if hasattr(time, "strftime"): - return strftime(datefmt, time.localtime(record.ct)) + return time.strftime(datefmt, time.localtime(record.ct)) return None def format(self, record):