summaryrefslogtreecommitdiff
path: root/coverage/collector.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2023-01-12 10:44:15 -0500
committerNed Batchelder <ned@nedbatchelder.com>2023-01-12 10:44:15 -0500
commit460dd98dae56d26f0611a0f6dc9c24e44435958f (patch)
tree9211005e2575fa5b3996312e04630f0875576c1f /coverage/collector.py
parent8fba8f18806b10e3713c124db538976527b7514d (diff)
downloadpython-coveragepy-git-460dd98dae56d26f0611a0f6dc9c24e44435958f.tar.gz
mypy: pytracer.py, the last file in coverage/
Diffstat (limited to 'coverage/collector.py')
-rw-r--r--coverage/collector.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/coverage/collector.py b/coverage/collector.py
index ab743ee3..22471504 100644
--- a/coverage/collector.py
+++ b/coverage/collector.py
@@ -232,7 +232,7 @@ class Collector:
def reset(self) -> None:
"""Clear collected data, and prepare to collect more."""
# The trace data we are collecting.
- self.data: TTraceData = {} # type: ignore[assignment]
+ self.data: TTraceData = {}
# A dictionary mapping file names to file tracer plugin names that will
# handle them.
@@ -310,12 +310,12 @@ class Collector:
#
# New in 3.12: threading.settrace_all_threads: https://github.com/python/cpython/pull/96681
- def _installation_trace(self, frame: FrameType, event: str, arg: Any) -> TTraceFn:
+ def _installation_trace(self, frame: FrameType, event: str, arg: Any) -> Optional[TTraceFn]:
"""Called on new threads, installs the real tracer."""
# Remove ourselves as the trace function.
sys.settrace(None)
# Install the real tracer.
- fn = self._start_tracer()
+ fn: Optional[TTraceFn] = self._start_tracer()
# Invoke the real trace function with the current event, to be sure
# not to lose an event.
if fn: