]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] 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:18:16 +0000 (19:18 +0100)
committerGitHub <noreply@github.com>
Tue, 20 Feb 2024 18:18:16 +0000 (18:18 +0000)
commit142711a31dc1469570aa5b5e76450314d6777bb2
tree511d168544607d9f241d4b36270807754866e688
parentaff083e8eee006dab392ac74453bd490a0154bd2
[3.11] gh-86291: linecache: get module name from __spec__ if available (GH-22908) (GH-115732)

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]