Skip to content

Commit

Permalink
[3.13] gh-118760: Fix errors in calling Tkinter bindings on Windows (G…
Browse files Browse the repository at this point in the history
…H-118782) (GH-119072)

For unknown reasons some arguments for Tkinter binding can be created
as a 1-tuple containing a Tcl_Obj when wantobjects is 2.
(cherry picked from commit 5b88d95)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
  • Loading branch information
miss-islington and serhiy-storchaka authored May 15, 2024
1 parent f85d59c commit 4f81915
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Lib/tkinter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1727,6 +1727,9 @@ def getint_event(s):
except (ValueError, TclError):
return s

if any(isinstance(s, tuple) for s in args):
args = [s[0] if isinstance(s, tuple) and len(s) == 1 else s
for s in args]
nsign, b, f, h, k, s, t, w, x, y, A, E, K, N, W, T, X, Y, D = args
# Missing: (a, c, d, m, o, v, B, R)
e = Event()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix errors in calling Tkinter bindings on Windows.

0 comments on commit 4f81915

Please sign in to comment.