Skip to content

Commit aa65c2e

Browse files
authored
similar changes for findsource
1 parent f0efff0 commit aa65c2e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/inspect.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -988,9 +988,9 @@ def findsource(object):
988988
raise OSError('lineno is out of bounds')
989989
return lines, lnum
990990

991-
if ismethod(object):
991+
if hasattr(object, '__func__'):
992992
object = object.__func__
993-
if isfunction(object):
993+
if hasattr(object, '__code__'):
994994
object = object.__code__
995995
if istraceback(object):
996996
object = object.tb_frame

0 commit comments

Comments
 (0)