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

Function _find_executable_linenos

tools/python-3.11.9-amd64/Lib/trace.py:373–385  ·  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

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

Callers 1

write_resultsMethod · 0.85

Calls 6

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

Tested by

no test coverage detected