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

Method globaltrace_lt

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

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

Callers

nothing calls this directly

Calls 4

_modnameFunction · 0.85
printFunction · 0.50
getMethod · 0.45
namesMethod · 0.45

Tested by

no test coverage detected