]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-86291: linecache: get module name from __spec__ if available (GH-22908...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 20 Feb 2024 18:14:24 +0000 (19:14 +0100)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 18:14:24 +0000 (18:14 +0000)
commitf1c1afd45b283b5ede3b1da39fc916c9ba2a6095
tree203c745e82d384f1019749590eef27ab77da180d
parent5ea86f496a4cfb34abbe2b7bb6fa7f25eeeb6294
[3.12] gh-86291: linecache: get module name from __spec__ if available (GH-22908) (GH-115731)

This allows getting source code for the __main__ module when a custom
loader is used.
(cherry picked from commit e976baba99a5c243ff3a3b5ef2fd14608a398338)

Co-authored-by: Eugene Toder <eltoder@users.noreply.github.com>
Lib/linecache.py
Lib/test/test_linecache.py
Misc/NEWS.d/next/Library/2020-12-15-22-30-49.bpo-42125.UGyseY.rst [new file with mode: 0644]