MCPcopy Index your code
hub / github.com/RustPython/RustPython / _ignore_deprecated_imports

Function _ignore_deprecated_imports

Lib/test/support/import_helper.py:17–29  ·  view source on GitHub ↗

Context manager to suppress package and module deprecation warnings when importing them. If ignore is False, this context manager has no effect.

(ignore=True)

Source from the content-addressed store, hash-verified

15
16@contextlib.contextmanager
17def _ignore_deprecated_imports(ignore=True):
18 """Context manager to suppress package and module deprecation
19 warnings when importing them.
20
21 If ignore is False, this context manager has no effect.
22 """
23 if ignore:
24 with warnings.catch_warnings():
25 warnings.filterwarnings("ignore", ".+ (module|package)",
26 DeprecationWarning)
27 yield
28 else:
29 yield
30
31
32def unload(name):

Callers 2

import_moduleFunction · 0.85
import_fresh_moduleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected