diff --git a/astroid/interpreter/_import/spec.py b/astroid/interpreter/_import/spec.py index 4938e1d7e..086007ff0 100644 --- a/astroid/interpreter/_import/spec.py +++ b/astroid/interpreter/_import/spec.py @@ -152,7 +152,9 @@ def find_module( processed and processed[0] in sys.stdlib_module_names ): try: - spec = importlib.util.find_spec(".".join((*processed, modname))) + with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=UserWarning) + spec = importlib.util.find_spec(".".join((*processed, modname))) except ValueError: # `find_spec` raises a ValueError for modules that are missing their `__spec__` # attributes. We don't really understand why, but this is likely caused by