mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Don't filter `ImportWarning
in
ext.autodoc.importer
` (#11024)
This commit is contained in:
parent
eb3fffc3e9
commit
05a14ff007
@ -5,7 +5,6 @@ from __future__ import annotations
|
||||
import importlib
|
||||
import traceback
|
||||
import typing
|
||||
import warnings
|
||||
from typing import TYPE_CHECKING, Any, Callable, NamedTuple
|
||||
|
||||
from sphinx.ext.autodoc.mock import ismock, undecorate
|
||||
@ -61,8 +60,6 @@ def import_module(modname: str, warningiserror: bool = False) -> Any:
|
||||
Call importlib.import_module(modname), convert exceptions to ImportError
|
||||
"""
|
||||
try:
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings("ignore", category=ImportWarning)
|
||||
with logging.skip_warningiserror(not warningiserror):
|
||||
return importlib.import_module(modname)
|
||||
except BaseException as exc:
|
||||
|
Loading…
Reference in New Issue
Block a user