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

+1-1
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)