Skip to content

Commit 6170ed0

Browse files
committed
Do a crappy check for "<module>" instead. Module code objects don't seem to have any other distinctin. Also, the code objects will never be of ModuleType.
1 parent bc5ddca commit 6170ed0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hunter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ def source(self, getlines=linecache.getlines):
199199
Get a line from ``linecache``. Ignores failures somewhat.
200200
"""
201201
try:
202-
if self.kind == 'call' and not isinstance(self.code, types.ModuleType):
202+
if self.kind == 'call' and self.code.co_name != "<module>":
203203
lines = []
204204
try:
205205
for _, token, _, _, line in tokenize.generate_tokens(partial(

0 commit comments

Comments
 (0)