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

Method globaltrace_lt

Lib/trace.py:531–552  ·  view source on GitHub ↗

Handler for call events. If the code block being entered is to be ignored, returns 'None', else returns self.localtrace.

(self, frame, why, arg)

Source from the content-addressed store, hash-verified

529 self._calledfuncs[this_func] = 1
530
531 def globaltrace_lt(self, frame, why, arg):
532 """Handler for call events.
533
534 If the code block being entered is to be ignored, returns 'None',
535 else returns self.localtrace.
536 """
537 if why == 'call':
538 code = frame.f_code
539 filename = frame.f_globals.get('__file__', None)
540 if filename:
541 # XXX _modname() doesn't work right for packages, so
542 # the ignore support won't work right for packages
543 modulename = _modname(filename)
544 if modulename is not None:
545 ignore_it = self.ignore.names(filename, modulename)
546 if not ignore_it:
547 if self.trace:
548 print((" --- modulename: %s, funcname: %s"
549 % (modulename, code.co_name)))
550 return self.localtrace
551 else:
552 return None
553
554 def localtrace_trace_and_count(self, frame, why, arg):
555 if why == "line":

Callers

nothing calls this directly

Calls 3

_modnameFunction · 0.85
getMethod · 0.45
namesMethod · 0.45

Tested by

no test coverage detected