Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7422347

Browse filesBrowse files
authored
Merge pull request #14144 from anntzer/useless
Deprecate the 'warn' parameter to matplotlib.use().
2 parents 3a7a47a + 7902910 commit 7422347
Copy full SHA for 7422347

File tree

Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-2
lines changed
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Deprecations
2+
````````````
3+
4+
The ``warn`` parameter to `matplotlib.use()` is deprecated (catch the
5+
`ImportError` emitted on backend switch failure and reemit a warning yourself
6+
if so desired).

‎lib/matplotlib/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/__init__.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,7 @@ def __exit__(self, exc_type, exc_value, exc_tb):
11701170

11711171

11721172
@cbook._rename_parameter("3.1", "arg", "backend")
1173+
@cbook._delete_parameter("3.1", "warn")
11731174
def use(backend, warn=False, force=True):
11741175
"""
11751176
Select the backend used for rendering and GUI integration.
@@ -1192,7 +1193,7 @@ def use(backend, warn=False, force=True):
11921193
11931194
warn : bool, optional, default: False
11941195
If True and not *force*, emit a warning if a failure-to-switch
1195-
`ImportError` has been suppressed.
1196+
`ImportError` has been suppressed. This parameter is deprecated.
11961197
11971198
force : bool, optional, default: True
11981199
If True (the default), raise an `ImportError` if the backend cannot be

‎lib/matplotlib/testing/__init__.py

Copy file name to clipboardExpand all lines: lib/matplotlib/testing/__init__.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def setup():
4242
"Could not set locale to English/United States. "
4343
"Some date-related tests may fail.")
4444

45-
mpl.use('Agg', force=True, warn=False) # use Agg backend for these tests
45+
mpl.use('Agg')
4646

4747
with cbook._suppress_matplotlib_deprecation_warning():
4848
mpl.rcdefaults() # Start with all defaults

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.