(self, signal, proxy, *, _is_finalizing=sys.is_finalizing)
| 322 | # Keep a reference to sys.is_finalizing, as sys may have been cleared out |
| 323 | # at that point. |
| 324 | def _remove_proxy(self, signal, proxy, *, _is_finalizing=sys.is_finalizing): |
| 325 | if _is_finalizing(): |
| 326 | # Weakrefs can't be properly torn down at that point anymore. |
| 327 | return |
| 328 | cid = self._func_cid_map.pop((signal, proxy), None) |
| 329 | if cid is not None: |
| 330 | del self.callbacks[signal][cid] |
| 331 | self._pickled_cids.discard(cid) |
| 332 | else: # Not found |
| 333 | return |
| 334 | if len(self.callbacks[signal]) == 0: # Clean up empty dicts |
| 335 | del self.callbacks[signal] |
| 336 | |
| 337 | @_api.rename_parameter("3.11", "cid", "cid_or_func") |
| 338 | def disconnect(self, cid_or_func, *, signal=None): |
no test coverage detected