MCPcopy Create free account
hub / github.com/numpy/numpy / _clear_registries

Method _clear_registries

numpy/testing/_private/utils.py:2088–2098  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2086 self._forwarding_rule = forwarding_rule
2087
2088 def _clear_registries(self):
2089 if hasattr(warnings, "_filters_mutated"):
2090 # clearing the registry should not be necessary on new pythons,
2091 # instead the filters should be mutated.
2092 warnings._filters_mutated()
2093 return
2094 # Simply clear the registry, this should normally be harmless,
2095 # note that on new pythons it would be invalidated anyway.
2096 for module in self._tmp_modules:
2097 if hasattr(module, "__warningregistry__"):
2098 module.__warningregistry__.clear()
2099
2100 def _filter(self, category=Warning, message="", module=None, record=False):
2101 if record:

Callers 3

_filterMethod · 0.95
__enter__Method · 0.95
__exit__Method · 0.95

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected