File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -86,13 +86,12 @@ def __init__(
8686 core_name = None
8787
8888 if core_name is None :
89- # Someday we will default to sysmon, but it's still experimental:
90- # if not reason_no_sysmon:
91- # core_name = "sysmon"
92- if CTRACER_FILE :
89+ if env .SYSMON_DEFAULT and not reason_no_sysmon :
90+ core_name = "sysmon"
91+ elif CTRACER_FILE :
9392 core_name = "ctrace"
9493 else :
95- if env . CPYTHON and IMPORT_ERROR :
94+ if IMPORT_ERROR and env . SHIPPING_WHEELS :
9695 warn (f"Couldn't import C tracer: { IMPORT_ERROR } " , slug = "no-ctracer" , once = True )
9796 core_name = "pytrace"
9897
Original file line number Diff line number Diff line change 4343# Do we have a GIL?
4444GIL = getattr (sys , '_is_gil_enabled' , lambda : True )()
4545
46+ # Do we ship compiled coveragepy wheels for this version?
47+ SHIPPING_WHEELS = CPYTHON and PYVERSION [:2 ] <= (3 , 13 )
48+
49+ # Should we default to sys.monitoring?
50+ SYSMON_DEFAULT = CPYTHON and PYVERSION >= (3 , 14 )
51+
4652# Python behavior.
4753class PYBEHAVIOR :
4854 """Flags indicating this Python's behavior."""
Original file line number Diff line number Diff line change @@ -1133,11 +1133,12 @@ def test_core_default(self) -> None:
11331133 self .make_file ("numbers.py" , "print(123, 456)" )
11341134 out = self .run_command ("coverage run --debug=sys numbers.py" )
11351135 assert out .endswith ("123 456\n " )
1136- core = re_line (r" core:" , out ).strip ()
1137- # if env.PYBEHAVIOR.pep669:
1138- # assert core == "core: SysMonitor"
11391136 warns = re_lines (r"\(no-ctracer\)" , out )
1140- if self .has_ctracer :
1137+ core = re_line (r" core:" , out ).strip ()
1138+ if env .SYSMON_DEFAULT :
1139+ assert core == "core: SysMonitor"
1140+ assert not warns
1141+ elif self .has_ctracer :
11411142 assert core == "core: CTracer"
11421143 assert not warns
11431144 else :
You can’t perform that action at this time.
0 commit comments