]> granicus.if.org Git - python/commitdiff
Issue #24408: Fixed AttributeError in measure() and metrics() methods of
authorSerhiy Storchaka <storchaka@gmail.com>
Mon, 8 Jun 2015 15:43:55 +0000 (18:43 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Mon, 8 Jun 2015 15:43:55 +0000 (18:43 +0300)
tkinter.Font.

Lib/tkinter/font.py
Misc/NEWS

index e74049c8aa3102b0b5db2c18fa5a81099e58d319..136425726ab8ce14d2963b24d1f0f84e2e4f7659 100644 (file)
@@ -151,7 +151,7 @@ class Font:
         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 @@ class Font:
             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
 
 
index 16098167bb27409738104fc34c427c1c9fd0b720..8be0e137c45e1437fbe1729b772670e8cda2f4d8 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -15,6 +15,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.