Use tk_scaling() instead of a raw Tcl call in IDLE and tkinter tests#152465
Closed
serhiy-storchaka wants to merge 2 commits into
Closed
Use tk_scaling() instead of a raw Tcl call in IDLE and tkinter tests#152465serhiy-storchaka wants to merge 2 commits into
serhiy-storchaka wants to merge 2 commits into
Conversation
* idlelib.run.fix_scaling(): root.tk_scaling() instead of
float(root.tk.call('tk', 'scaling'));
* tkinter widget tests: root.tk_scaling() instead of
float(root.call('tk', 'scaling')).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
terryjreedy
approved these changes
Jun 29, 2026
terryjreedy
left a comment
Member
There was a problem hiding this comment.
I will move fix_scaling to idlelib.util after this is merged.
Member
|
On second thought, it would be much easier to backport the move first, with the body the same in all versions, and then revise or replace this main-only PR. What do you think? |
Member
Author
|
This is up to you. This change is tiny and can easily be applied manually. |
Member
|
Functions, including fix_scaling, moved to util.py in #152728. |
Member
|
I will write a replacement later today (easy) unless you do. And respond to multiple comments on IDLE isssues. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace explicit
tk.call()invocations withtk_scaling(), which already returns a float. No behavior change.idlelib.run.fix_scaling():root.tk_scaling()instead offloat(root.tk.call('tk', 'scaling')).root.tk_scaling()instead offloat(root.call('tk', 'scaling')).Split out from GH-152414 because
tk_scaling()was only added in 3.16 (gh-151881), so this part is not backported.