diff --git a/Lib/idlelib/run.py b/Lib/idlelib/run.py index e1c40fee8f4805..c3f869ec4d75bd 100644 --- a/Lib/idlelib/run.py +++ b/Lib/idlelib/run.py @@ -392,7 +392,7 @@ def exit(): def fix_scaling(root): """Scale fonts on HiDPI displays.""" 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) diff --git a/Lib/test/test_tkinter/widget_tests.py b/Lib/test/test_tkinter/widget_tests.py index 014906cba2902c..05e60f7ee118e3 100644 --- a/Lib/test/test_tkinter/widget_tests.py +++ b/Lib/test/test_tkinter/widget_tests.py @@ -34,7 +34,7 @@ def scaling(self): 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):