Skip to content

Commit d41c0e6

Browse files
gh-128846: Fix the normalization direction in test_configure_custom_copy
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent baabe07 commit d41c0e6

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Lib/test/test_ttk/test_style.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,12 @@ def test_configure_custom_copy(self):
161161
newname = f'C.{name}'
162162
self.assertEqual(style.configure(newname), None)
163163
style.configure(newname, **default)
164-
# With Tk 9 and the aqua theme an empty option value is
165-
# read back as an empty tuple rather than an empty string
166-
# (see gh-128846); normalize before comparing.
164+
# gh-128846: on 3.13 the aqua theme with Tk 9 reports an
165+
# unset option as an empty tuple in the original style but
166+
# as an empty string in the copy. Normalize the copy back
167+
# to the empty tuple before comparing.
167168
def norm(value):
168-
return '' if value == () else value
169+
return () if value == '' else value
169170
copy = style.configure(newname)
170171
self.assertEqual({k: norm(v) for k, v in copy.items()},
171172
default)

0 commit comments

Comments
 (0)