Skip to content

[MNT] Use Literal for level parameter in set_loglevel (#30257) #30260

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
import sys
import tempfile


from packaging.version import parse as parse_version

# cbook must import matplotlib only within function
Expand Down Expand Up @@ -309,7 +310,6 @@ def set_loglevel(level):
The first time this function is called, an additional handler is attached
to Matplotlib's root handler; this handler is reused every time and this
function simply manipulates the logger and handler's level.

"""
_log.setLevel(level.upper())
_ensure_handler().setLevel(level.upper())
Expand Down