Replace `tk.call('tk', 'scaling')` with `tk_scaling()`, which
returns a float, in idlelib.util and test_tkinter.widget_tests.
Co-authored-by: serhiy-storchaka
def fix_scaling(root): # Called in filelist _test, pyshell, and run.
"""Scale fonts on HiDPI displays, once per process."""
import tkinter.font
- scaling = float(root.tk.call('tk', 'scaling'))
+ scaling = root.tk_scaling()
if scaling > 1.4:
for name in tkinter.font.names(root):
font = tkinter.font.Font(root=root, name=name, exists=True)
try:
return self._scaling
except AttributeError:
- self._scaling = float(self.root.call('tk', 'scaling'))
+ self._scaling = self.root.tk_scaling()
return self._scaling
def _str(self, value):