File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Original file line number Diff line number Diff line change @@ -847,12 +847,14 @@ def begin_typing(self, x):
847
847
self .capturekeystrokes = True
848
848
# Check for toolmanager handling the keypress
849
849
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.
852
852
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.' )}))
856
858
else :
857
859
self .ax .figure .canvas .manager .toolmanager .keypresslock (self )
858
860
You can’t perform that action at this time.
0 commit comments