Skip to content

Commit 66e631b

Browse files
Optimize logging imports by using lazy loading for traceback
1 parent 517d3d2 commit 66e631b

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Lib/logging/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
To use, simply 'import logging' and log away!
2424
"""
2525

26-
import sys, os, time, io, re, traceback, warnings, weakref, collections.abc
26+
import sys, os, time, io, re, warnings, weakref, collections.abc
27+
lazy import traceback
2728

2829
from types import GenericAlias
2930
from string import Template

Lib/logging/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import re
3535
import struct
3636
import threading
37-
import traceback
37+
lazy import traceback
3838

3939
from socketserver import ThreadingTCPServer, StreamRequestHandler
4040

0 commit comments

Comments
 (0)