Skip to content

[3.13] gh-128846: Fix test_configure_custom_copy for the aqua theme with Tk 9#153611

Open
serhiy-storchaka wants to merge 1 commit into
python:3.13from
serhiy-storchaka:gh-128846-ttk-style-copy-test
Open

[3.13] gh-128846: Fix test_configure_custom_copy for the aqua theme with Tk 9#153611
serhiy-storchaka wants to merge 1 commit into
python:3.13from
serhiy-storchaka:gh-128846-ttk-style-copy-test

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

On macOS with the aqua theme and Tk 9, an empty ttk style option value is
read back as an empty tuple rather than an empty string, so
test_configure_custom_copy failed when comparing a copied style against its
default. Normalize the empty tuple to an empty string before comparing.

Test-only; 3.13 lacks the _tclobj_to_py normalization that fixes this in
the library on 3.14+.

…heme with Tk 9

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
# read back as an empty tuple rather than an empty string
# (see gh-128846); normalize before comparing.
def norm(value):
return '' if value == () else value

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return '' if value == () else value
return () if value == '' else value

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant