Skip to content

Commit 8a7eb40

Browse files
committed
logging: Simplify check for strftime.
Only needs to be checked at the call site. Signed-off-by: Jim Mussared <[email protected]>
1 parent 58bab0a commit 8a7eb40

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

python-stdlib/logging/logging.py

+1-4
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
import sys
44
import time
55

6-
if hasattr(time, "strftime"):
7-
from time import strftime
8-
96
CRITICAL = const(50)
107
ERROR = const(40)
118
WARNING = const(30)
@@ -92,7 +89,7 @@ def usesTime(self):
9289

9390
def formatTime(self, datefmt, record):
9491
if hasattr(time, "strftime"):
95-
return strftime(datefmt, time.localtime(record.ct))
92+
return time.strftime(datefmt, time.localtime(record.ct))
9693
return None
9794

9895
def format(self, record):

0 commit comments

Comments
 (0)