MCPcopy Index your code
hub / github.com/python/cpython / _getsourcelines

Method _getsourcelines

Lib/pdb.py:2603–2611  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

2601 return ""
2602
2603 def _getsourcelines(self, obj):
2604 # GH-103319
2605 # inspect.getsourcelines() returns lineno = 0 for
2606 # module-level frame which breaks our code print line number
2607 # This method should be replaced by inspect.getsourcelines(obj)
2608 # once this bug is fixed in inspect
2609 lines, lineno = inspect.getsourcelines(obj)
2610 lineno = max(1, lineno)
2611 return lines, lineno
2612
2613 def _help_message_from_doc(self, doc, usage_only=False):
2614 lines = [line.strip() for line in doc.rstrip().splitlines()]

Callers 2

do_longlistMethod · 0.95
do_sourceMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected