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

Method _clear_registries

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

Source from the content-addressed store, hash-verified

2384 self._forwarding_rule = forwarding_rule
2385
2386 def _clear_registries(self):
2387 if hasattr(warnings, "_filters_mutated"):
2388 # clearing the registry should not be necessary on new pythons,
2389 # instead the filters should be mutated.
2390 warnings._filters_mutated()
2391 return
2392 # Simply clear the registry, this should normally be harmless,
2393 # note that on new pythons it would be invalidated anyway.
2394 for module in self._tmp_modules:
2395 if hasattr(module, "__warningregistry__"):
2396 module.__warningregistry__.clear()
2397
2398 def _filter(self, category=Warning, message="", module=None, record=False):
2399 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