Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent warning filters from being discarded #11024

Merged
merged 4 commits into from
Jul 28, 2023

Conversation

teobouvard
Copy link
Contributor

@teobouvard teobouvard commented Dec 10, 2022

Using a context manager to ignore ImportWarning during module imports also prevents libraries setting warning filters (such as NumPy) from being persistent, since the filters they set are discarded when exiting the context manager.

I might be missing something, but it seems the usage of this context manager to ignore such warnings is redundant with the default warning filters installed by Python.

Closes #11022

Using a context manager to ignore ImportWarning during module imports
also prevents libraries setting warnings filters (such as NumPy) from
being persistent, since the filters they set are discarded when exiting
the context manager.

Closes sphinx-doc#11022
@teobouvard teobouvard changed the title Prevent warnings filters from being discarded Prevent warning filters from being discarded Dec 11, 2022
@AA-Turner AA-Turner added this to the some future version milestone Apr 29, 2023
# Conflicts:
#	sphinx/ext/autodoc/importer.py
@AA-Turner AA-Turner merged commit 05a14ff into sphinx-doc:master Jul 28, 2023
26 of 27 checks passed
@AA-Turner
Copy link
Member

Thanks @teobouvard!

A

@AA-Turner AA-Turner modified the milestones: some future version, 7.2.0 Aug 11, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Runtime warnings filters are ignored
2 participants