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

Function _find_executable_linenos

Lib/trace.py:376–388  ·  view source on GitHub ↗

Return dict where keys are line numbers in the line number table.

(filename)

Source from the content-addressed store, hash-verified

374 return d
375
376def _find_executable_linenos(filename):
377 """Return dict where keys are line numbers in the line number table."""
378 try:
379 with tokenize.open(filename) as f:
380 prog = f.read()
381 encoding = f.encoding
382 except OSError as err:
383 print(("Not printing coverage data for %r: %s"
384 % (filename, err)), file=sys.stderr)
385 return {}
386 code = compile(prog, filename, "exec")
387 strs = _find_strings(filename, encoding)
388 return _find_lines(code, strs)
389
390class Trace:
391 def __init__(self, count=1, trace=1, countfuncs=0, countcallers=0,

Callers 1

write_resultsMethod · 0.85

Calls 5

_find_stringsFunction · 0.85
_find_linesFunction · 0.85
compileFunction · 0.70
openMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…