Skip to content

Commit 5b88d95

Browse files
gh-118760: Fix errors in calling Tkinter bindings on Windows (GH-118782)
For unknown reasons some arguments for Tkinter binding can be created as a 1-tuple containing a Tcl_Obj when wantobjects is 2.
1 parent 7d722b7 commit 5b88d95

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Lib/tkinter/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,6 +1727,9 @@ def getint_event(s):
17271727
except (ValueError, TclError):
17281728
return s
17291729

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

0 commit comments

Comments
 (0)