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

Method localtrace_trace

Lib/trace.py:573–588  ·  view source on GitHub ↗
(self, frame, why, arg)

Source from the content-addressed store, hash-verified

571 return self.localtrace
572
573 def localtrace_trace(self, frame, why, arg):
574 if why == "line":
575 # record the file name and line number of every trace
576 filename = frame.f_code.co_filename
577 lineno = frame.f_lineno
578
579 if self.start_time:
580 print('%.2f' % (_time() - self.start_time), end=' ')
581 bname = os.path.basename(filename)
582 line = linecache.getline(filename, lineno)
583 print("%s(%d)" % (bname, lineno), end='')
584 if line:
585 print(": ", line, end='')
586 else:
587 print()
588 return self.localtrace
589
590 def localtrace_count(self, frame, why, arg):
591 if why == "line":

Callers

nothing calls this directly

Calls 2

basenameMethod · 0.45
getlineMethod · 0.45

Tested by

no test coverage detected