Skip to content

Commit e0ac654

Browse files
Use f_code.co_name for module frame checking
1 parent 790ff6b commit e0ac654

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/pdb.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def find_function(funcname, filename):
109109

110110
def getsourcelines(obj):
111111
lines, lineno = inspect.findsource(obj)
112-
if inspect.isframe(obj) and obj.f_globals is obj.f_locals:
112+
if inspect.isframe(obj) and obj.f_code.co_name == "<module>":
113113
# must be a module frame: do not try to cut a block out of it
114114
return lines, 1
115115
elif inspect.ismodule(obj):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy