summaryrefslogtreecommitdiff
path: root/coverage/collector.py
diff options
context:
space:
mode:
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: