diff --git a/Lib/tkinter/font.py b/Lib/tkinter/font.py index e74049c8aa3..136425726ab 100644 --- a/Lib/tkinter/font.py +++ b/Lib/tkinter/font.py @@ -151,7 +151,7 @@ def measure(self, text, displayof=None): args = (text,) if displayof: args = ('-displayof', displayof, text) - return self._root.tk.getint(self._call("font", "measure", self.name, *args)) + return self._tk.getint(self._call("font", "measure", self.name, *args)) def metrics(self, *options, **kw): """Return font metrics. @@ -164,13 +164,13 @@ def metrics(self, *options, **kw): args = ('-displayof', displayof) if options: args = args + self._get(options) - return self._root.tk.getint( + return self._tk.getint( self._call("font", "metrics", self.name, *args)) else: res = self._split(self._call("font", "metrics", self.name, *args)) options = {} for i in range(0, len(res), 2): - options[res[i][1:]] = self._root.tk.getint(res[i+1]) + options[res[i][1:]] = self._tk.getint(res[i+1]) return options diff --git a/Misc/NEWS b/Misc/NEWS index a133e3c46bd..d29022a6616 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -27,6 +27,9 @@ Core and Builtins Library ------- +- Issue #24408: Fixed AttributeError in measure() and metrics() methods of + tkinter.Font. + - Issue #14373: C implementation of functools.lru_cache() now can be used with methods.