1010from typing import Any
1111
1212from coverage import env
13+ from coverage .config import CoverageConfig
1314from coverage .disposition import FileDisposition
1415from coverage .exceptions import ConfigError
1516from coverage .misc import isolate_module
@@ -52,16 +53,9 @@ class Core:
5253 packed_arcs : bool
5354 systrace : bool
5455
55- def __init__ (self ,
56- warn : TWarnFn ,
57- timid : bool ,
58- metacov : bool ,
59- ) -> None :
60- # Defaults
61- self .tracer_kwargs = {}
62-
56+ def __init__ (self , warn : TWarnFn , config : CoverageConfig , metacov : bool ) -> None :
6357 core_name : str | None
64- if timid :
58+ if config . timid :
6559 core_name = "pytrace"
6660 else :
6761 core_name = os .getenv ("COVERAGE_CORE" )
@@ -70,6 +64,13 @@ def __init__(self,
7064 warn ("sys.monitoring isn't available, using default core" , slug = "no-sysmon" )
7165 core_name = None
7266
67+ # if core_name == "sysmon" and config.branch and not env.PYBEHAVIOR.branch_right_left:
68+ # warn(
69+ # "sys.monitoring can't yet measure branches well, using default core",
70+ # slug="no-sysmon",
71+ # )
72+ # core_name = None
73+
7374 if not core_name :
7475 # Once we're comfortable with sysmon as a default:
7576 # if env.PYBEHAVIOR.pep669 and self.should_start_context is None:
@@ -79,9 +80,11 @@ def __init__(self,
7980 else :
8081 core_name = "pytrace"
8182
83+ self .tracer_kwargs = {}
84+
8285 if core_name == "sysmon" :
8386 self .tracer_class = SysMonitor
84- self .tracer_kwargs = { "tool_id" : 3 if metacov else 1 }
87+ self .tracer_kwargs [ "tool_id" ] = 3 if metacov else 1
8588 self .file_disposition_class = FileDisposition
8689 self .supports_plugins = False
8790 self .packed_arcs = False
0 commit comments