Skip to content

Commit b242d1c

Browse files
pythongh-154511: Set the scaling with the Tcl command in test_fix_scaling
Misc.tk_scaling is new in 3.16, and fix_scaling itself calls "tk scaling" here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 7f2f53c commit b242d1c

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Lib/idlelib/idle_test/test_util.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,16 +125,17 @@ def tearDownClass(cls):
125125
def test_fix_scaling(self):
126126
from tkinter import font
127127
root = self.root
128-
self.addCleanup(root.tk_scaling, root.tk_scaling())
128+
scaling = root.tk.call('tk', 'scaling') # No Misc.tk_scaling yet.
129+
self.addCleanup(root.tk.call, 'tk', 'scaling', scaling)
129130
# Both fonts go with the root; Font.delete_font is a flag.
130131
pixels = font.Font(root=root, name='TestPixelFont', size=-16)
131132
points = font.Font(root=root, name='TestPointFont', size=12)
132133

133-
root.tk_scaling(1.0)
134+
root.tk.call('tk', 'scaling', 1.0)
134135
util.fix_scaling(root) # No scaling, no change.
135136
self.assertEqual(int(pixels['size']), -16)
136137

137-
root.tk_scaling(2.0)
138+
root.tk.call('tk', 'scaling', 2.0)
138139
util.fix_scaling(root) # A size in pixels becomes one in points.
139140
self.assertEqual(int(pixels['size']), 12) # round(-0.75 * -16)
140141
self.assertEqual(int(points['size']), 12) # Points are left alone.

0 commit comments

Comments
 (0)