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 7802d26

Browse filesBrowse files
committed
Fix deprecation of backend_tools.ToolBase.destroy
If not overridden, this will crash since it attempts to call `None()`.
1 parent 91f3465 commit 7802d26
Copy full SHA for 7802d26

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+4
-2
lines changed

‎lib/matplotlib/backend_managers.py

Copy file name to clipboardExpand all lines: lib/matplotlib/backend_managers.py
+4-2Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,11 @@ def remove_tool(self, name):
206206
"""
207207

208208
tool = self.get_tool(name)
209-
_api.deprecate_method_override(
209+
destroy = _api.deprecate_method_override(
210210
backend_tools.ToolBase.destroy, tool, since="3.6",
211-
alternative="tool_removed_event")()
211+
alternative="tool_removed_event")
212+
if destroy is not None:
213+
destroy()
212214

213215
# If it's a toggle tool and toggled, untoggle
214216
if getattr(tool, 'toggled', False):

0 commit comments

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