Skip to content

Commit

Permalink
wip: remove defensive code fixed by 111963
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 5, 2025
1 parent f6c9252 commit f6badce
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions coverage/sysmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

"""Callback functions and support for sys.monitoring data collection."""

# TODO: https://github.com/python/cpython/issues/111963#issuecomment-2386584080
# commented out stuff with 111963 below...

from __future__ import annotations

import dis
Expand Down Expand Up @@ -327,9 +324,6 @@ def __init__(self, tool_id: int) -> None:
# A list of code_objects, just to keep them alive so that id's are
# useful as identity.
self.code_objects: list[CodeType] = []
# 111963:
# # Map id(code_object) -> code_object
# self.local_event_codes: dict[int, CodeType] = {}
self.sysmon_on = False
self.lock = threading.Lock()

Expand Down Expand Up @@ -383,12 +377,7 @@ def stop(self) -> None:
return
assert sys_monitoring is not None
sys_monitoring.set_events(self.myid, 0)
with self.lock:
self.sysmon_on = False
# 111963:
# for code in self.local_event_codes.values():
# sys_monitoring.set_local_events(self.myid, code, 0)
# self.local_event_codes = {}
self.sysmon_on = False
sys_monitoring.free_tool_id(self.myid)

@panopticon()
Expand Down Expand Up @@ -474,8 +463,6 @@ def sysmon_py_start( # pylint: disable=useless-return
| events.BRANCH_LEFT # type:ignore[attr-defined]
)
sys_monitoring.set_local_events(self.myid, code, local_events)
# 111963:
# self.local_event_codes[id(code)] = code

return None

Expand Down

0 comments on commit f6badce

Please sign in to comment.