Skip to content

Commit 4a80a41

Browse files
authored
Merge pull request #26474 from story645/sphinx-conf
[DOC]: filter non-gui backend warnings when building docs
2 parents f800bf6 + 3a5e0b7 commit 4a80a41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/conf.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,9 @@ def _check_dependencies():
160160
# The following import is only necessary to monkey patch the signature later on
161161
from sphinx_gallery import gen_rst
162162

163-
# On Linux, prevent plt.show() from emitting a non-GUI backend warning.
164-
os.environ.pop("DISPLAY", None)
163+
# Prevent plt.show() from emitting a non-GUI backend warning.
164+
warnings.filterwarnings('ignore', category=UserWarning,
165+
message=r'(\n|.)*is non-interactive, and thus cannot be shown')
165166

166167
autosummary_generate = True
167168
autodoc_typehints = "none"

0 commit comments

Comments
 (0)