summaryrefslogtreecommitdiff
path: root/Lib/tkinter
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-04-17 09:39:28 +0300
committerSerhiy Storchaka <storchaka@gmail.com>2016-04-17 09:39:28 +0300
commit67dfb592d054602f43aa6f3239552709ed42a6c8 (patch)
treee40fb975728a2c7d941b657306aa078a16753adc /Lib/tkinter
parent9f70a4849d1a62db5ec8e2ba5b06784d69480fe3 (diff)
parent619fd27374ff0713563a37678f6d8f6ad9fc30f5 (diff)
downloadcpython-67dfb592d054602f43aa6f3239552709ed42a6c8.tar.gz
Issue #26778: Fixed "a/an/and" typos in code comment, documentation and error
messages.
Diffstat (limited to 'Lib/tkinter')
-rw-r--r--Lib/tkinter/__init__.py3
-rw-r--r--Lib/tkinter/test/test_tkinter/test_widgets.py7
-rw-r--r--Lib/tkinter/ttk.py10
3 files changed, 12 insertions, 8 deletions
diff --git a/Lib/tkinter/__init__.py b/Lib/tkinter/__init__.py
index be6ed7585b..5272b3095a 100644
--- a/Lib/tkinter/__init__.py
+++ b/Lib/tkinter/__init__.py
@@ -845,8 +845,7 @@ class Misc:
self.tk.call('winfo', 'height', self._w))
def winfo_id(self):
"""Return identifier ID for this widget."""
- return self.tk.getint(
- self.tk.call('winfo', 'id', self._w))
+ return int(self.tk.call('winfo', 'id', self._w), 0)
def winfo_interps(self, displayof=0):
"""Return the name of all Tcl interpreters for this display."""
args = ('winfo', 'interps') + self._displayof(displayof)
diff --git a/Lib/tkinter/test/test_tkinter/test_widgets.py b/Lib/tkinter/test/test_tkinter/test_widgets.py
index c924d55937..81b52eafea 100644
--- a/Lib/tkinter/test/test_tkinter/test_widgets.py
+++ b/Lib/tkinter/test/test_tkinter/test_widgets.py
@@ -91,9 +91,10 @@ class ToplevelTest(AbstractToplevelTest, unittest.TestCase):
widget = self.create()
self.assertEqual(widget['use'], '')
parent = self.create(container=True)
- wid = parent.winfo_id()
- widget2 = self.create(use=wid)
- self.assertEqual(int(widget2['use']), wid)
+ wid = hex(parent.winfo_id())
+ with self.subTest(wid=wid):
+ widget2 = self.create(use=wid)
+ self.assertEqual(widget2['use'], wid)
@add_standard_options(StandardOptionsTests)
diff --git a/Lib/tkinter/ttk.py b/Lib/tkinter/ttk.py
index 7d868fb630..e22a4e0c37 100644
--- a/Lib/tkinter/ttk.py
+++ b/Lib/tkinter/ttk.py
@@ -381,7 +381,9 @@ class Style(object):
a sequence identifying the value for that option."""
if query_opt is not None:
kw[query_opt] = None
- return _val_or_dict(self.tk, kw, self._name, "configure", style)
+ result = _val_or_dict(self.tk, kw, self._name, "configure", style)
+ if result or query_opt:
+ return result
def map(self, style, query_opt=None, **kw):
@@ -466,12 +468,14 @@ class Style(object):
def element_names(self):
"""Returns the list of elements defined in the current theme."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "names"))
+ return tuple(n.lstrip('-') for n in self.tk.splitlist(
+ self.tk.call(self._name, "element", "names")))
def element_options(self, elementname):
"""Return the list of elementname's options."""
- return self.tk.splitlist(self.tk.call(self._name, "element", "options", elementname))
+ return tuple(o.lstrip('-') for o in self.tk.splitlist(
+ self.tk.call(self._name, "element", "options", elementname)))
def theme_create(self, themename, parent=None, settings=None):