Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0b1660b

Browse files
narrow TclError handling
1 parent 78a1e43 commit 0b1660b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/matplotlib/backends/_backend_tk.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,9 @@ def blit(photoimage, aggimage, offsets, bbox=None):
111111

112112
try:
113113
photoimage.tk.call(_blit_tcl_name, argsid)
114-
except tk.TclError:
115-
# register _blit with code copied from tkinter.Misc._register
114+
except tk.TclError as e:
115+
if "invalid command name" not in str(e):
116+
raise
116117
photoimage.tk.createcommand(_blit_tcl_name, _blit)
117118
photoimage.tk.call(_blit_tcl_name, argsid)
118119

0 commit comments

Comments
 (0)