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

Method localtrace_trace_and_count

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

Source from the content-addressed store, hash-verified

552 return None
553
554 def localtrace_trace_and_count(self, frame, why, arg):
555 if why == "line":
556 # record the file name and line number of every trace
557 filename = frame.f_code.co_filename
558 lineno = frame.f_lineno
559 key = filename, lineno
560 self.counts[key] = self.counts.get(key, 0) + 1
561
562 if self.start_time:
563 print('%.2f' % (_time() - self.start_time), end=' ')
564 bname = os.path.basename(filename)
565 line = linecache.getline(filename, lineno)
566 print("%s(%d)" % (bname, lineno), end='')
567 if line:
568 print(": ", line, end='')
569 else:
570 print()
571 return self.localtrace
572
573 def localtrace_trace(self, frame, why, arg):
574 if why == "line":

Callers

nothing calls this directly

Calls 3

getMethod · 0.45
basenameMethod · 0.45
getlineMethod · 0.45

Tested by

no test coverage detected