Issue 19379: Don't import linecache at warnings toplevel (original) (raw)

Issue19379

Created on 2013-10-24 20:09 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
warnings_lazy.patch pitrou,2013-10-24 20:09 review
Messages (4)
msg201174 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2013-10-24 20:09
Importing warnings pulls linecache at the top-level, while it's only necessary when printing warnings. The reason why it wasn't done lazily is obsolete, since Python now has per-module import locks. Attached patch makes the linecache imports lazy. This is desirable for issue #19375.
msg201178 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-10-24 20:15
LGTM Good catch! :)
msg201179 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-10-24 20:15
LGTM
msg201182 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-24 20:24
New changeset 8939c0196990 by Antoine Pitrou in branch 'default': Close #19379: Lazily import linecache in the warnings module, to make startup with warnings faster until a warning gets printed. http://hg.python.org/cpython/rev/8939c0196990
History
Date User Action Args
2022-04-11 14:57:52 admin set github: 63578
2013-10-24 20:24:49 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: patch review -> resolved
2013-10-24 20:15:26 brett.cannon set messages: +
2013-10-24 20:15:14 christian.heimes set messages: +
2013-10-24 20:09:10 pitrou create