You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
inspect.{getsourcelines, findsource} return 0 as the starting line number for modules #103319
changed the title [-]`inspect.getsourcelines` returns 0 as the starting line number for modules[/-][+]`inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules[/+]on Apr 6, 2023
Activity
[-]`inspect.getsourcelines` returns 0 as the starting line number for modules[/-][+]`inspect.{getsourcelines, findsource}` return 0 as the starting line number for modules[/+]George-Ogden commentedon Jul 20, 2025
inspect.getsourcelines(frame)seems to return the 1-based index or 0 (when the whole file is returned).Here are some examples:
Currently, I work around this with: