File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments