Remove unused TK_AQUA code #103538
Description
Sections of code which are guarded by #ifdef TK_AQUA were committed in cb85244. But from examining the CPython
and Tcl/Tk repository histories, it appears nothing has ever defined this macro. (Tk Aqua itself instead defines/uses the MAC_OSX_TK macro.) The only mentions of it I found elsewhere were as -DTK_AQUA passed to build commands, either in a Setup.local file (https://mail.python.org/pipermail/pythonmac-sig/2001-December/004553.html, https://mail.python.org/pipermail/pythonmac-sig/2002-November/006746.html) or manual command line invocation (https://mail.python.org/pipermail/pythonmac-sig/2002-January/004776.html).
So I believe this code has long been unused, and I suspect that trying to use it now is not a good idea. Can it be removed?
Activity
pythongh-103538: Remove unused TK_AQUA code
hugovk commentedon Apr 14, 2023
I didn't find any relevant use using GitHub's beta code search:
And zero use in the top 5k PyPI projects:
For reference, the commit references BPO number 490100, which is now at gh-35685.
There's some mention of Aqua Tk and
TK_AQUAin #49370, ping participants @terryjreedy, @ronaldoussoren, @ned-deily.And #49370 (comment) says:
Working link to
ChangeLog.2004: https://github.com/tcltk/tk/blob/64e6bc556004238f93a9ccb5c2b826aed8310882/ChangeLog.2004#L210-L220Searching https://github.com/tcltk/tk I don't find
TK_AQUAorTKINTER_OLD_AQUAin uppercase, or searching withgit log -S TK_AQUAetc. Also noTKINTER_OLD_AQUAin any case.However, there are still some lowercase
tk_aquain:unix/configure.acunix/configureChangeLog.2007https://github.com/search?q=repo%3Atcltk%2Ftk%20tk_aqua&type=code
Are they relevant?
chrstphrchvz commentedon Apr 14, 2023
I checked
git log -S TK_AQUA(which I imagine is more exhaustive than the GitHub code search) for a deep clone of CPython and the only commit it lists is cb85244.Thanks for finding the patch issue; I was not sure where I might find that.
Thanks for bringing that issue up as well; I did not notice it during my earlier search. The changes proposed in oldtkaqua.diff still do not cause
TK_AQUAto be defined anywhere, so I do not think that patch ever had any effect. But since that patch intended to make the relevant code apply only to Tk 8.4.7 and earlier, and Tkinter has since required 8.5.12 or later, I believe that is further indication that the code can now be removed.In the configure scripts, lowercase
tk_aquais just a shell script variable. It is used to define a macro:…but there is nothing similar to define
TK_AQUA.pythongh-103538: Remove unused TK_AQUA code
hugovk commentedon Apr 14, 2023
Thanks for checking. @zware: here's another cleanup like #103532, looks okay?
I guessed the number could be a BPO number, you can find them in the old tracker at https://bugs.python.org tracker which has redirects to the migrated issues here on GitHub. (I used my CLI https://github.com/hugovk/pepotron and typed in
bpo 490100and it opened the GH issue directly.)pythongh-103538: Remove unused TK_AQUA code
pythongh-103538: Remove unused TK_AQUA code
pythongh-103538: Remove unused TK_AQUA code
pythongh-103538: Remove unused TK_AQUA code
gh-103538: Remove unused TK_AQUA code (GH-103539)
zware commentedon May 10, 2023
Thanks for the cleanup!
Merge branch 'main' into fixloadsuperspec
Merge branch 'main' into supermon