MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / _getsourcelines

Method _getsourcelines

tools/python-3.11.9-amd64/Lib/pdb.py:1648–1656  ·  view source on GitHub ↗
(self, obj)

Source from the content-addressed store, hash-verified

1646 return traceback.format_exception_only(exc)[-1].strip()
1647
1648 def _getsourcelines(self, obj):
1649 # GH-103319
1650 # inspect.getsourcelines() returns lineno = 0 for
1651 # module-level frame which breaks our code print line number
1652 # This method should be replaced by inspect.getsourcelines(obj)
1653 # once this bug is fixed in inspect
1654 lines, lineno = inspect.getsourcelines(obj)
1655 lineno = max(1, lineno)
1656 return lines, lineno
1657
1658# Collect all command help into docstring, if not run with -OO
1659

Callers 2

do_longlistMethod · 0.95
do_sourceMethod · 0.95

Calls 1

maxFunction · 0.85

Tested by

no test coverage detected