From f946604af87b8a39187d67bba70dfbd143966c1e Mon Sep 17 00:00:00 2001 From: tconley1428 Date: Tue, 28 Oct 2025 23:06:22 -0700 Subject: [PATCH] gh-140228: Avoid making unnecessary syscalls in linecache for frozen modules (GH-140377) (cherry picked from commit c41f84ff61c52e3ff7ef86b0c66208b29613d23d) Co-authored-by: tconley1428 --- Lib/linecache.py | 5 ++++- .../Library/2025-10-28-17-43-51.gh-issue-140228.8kfHhO.rst | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 Misc/NEWS.d/next/Library/2025-10-28-17-43-51.gh-issue-140228.8kfHhO.rst diff --git a/Lib/linecache.py b/Lib/linecache.py index 87d7d6fda657e4..2b5a31b3e75bc1 100644 --- a/Lib/linecache.py +++ b/Lib/linecache.py @@ -131,9 +131,12 @@ def updatecache(filename, module_globals=None): if _source_unavailable(filename): return [] - if filename.startswith('