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 3f78c1a

Browse filesBrowse files
authored
Merge pull request #17043 from anntzer/textboxkeymapdep
Avoid spurious deprecation warning in TextBox.
2 parents 3b779df + 1aa5352 commit 3f78c1a
Copy full SHA for 3f78c1a

File tree

Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-5
lines changed

‎lib/matplotlib/widgets.py

Copy file name to clipboardExpand all lines: lib/matplotlib/widgets.py
+7-5Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -847,12 +847,14 @@ def begin_typing(self, x):
847847
self.capturekeystrokes = True
848848
# Check for toolmanager handling the keypress
849849
if self.ax.figure.canvas.manager.key_press_handler_id is not None:
850-
# disable command keys so that the user can type without
851-
# command keys causing figure to be saved, etc
850+
# Disable command keys so that the user can type without
851+
# command keys causing figure to be saved, etc.
852852
self._restore_keymap = ExitStack()
853-
self._restore_keymap.enter_context(
854-
mpl.rc_context(
855-
{k: [] for k in mpl.rcParams if k.startswith('keymap.')}))
853+
# Avoid spurious warnings if keymaps are getting deprecated.
854+
with cbook._suppress_matplotlib_deprecation_warning():
855+
self._restore_keymap.enter_context(
856+
mpl.rc_context({k: [] for k in mpl.rcParams
857+
if k.startswith('keymap.')}))
856858
else:
857859
self.ax.figure.canvas.manager.toolmanager.keypresslock(self)
858860

0 commit comments

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