summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-01-11 11:12:58 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-01-11 11:12:58 (GMT)
commit2bca9deecb7f8dd138a37b60bfb1724e213a5fed (patch)
treedc03cdeb4737a38525d8b5e966c1a66e1514c4b9
parent6183f7011961d555c86cc73333db13bc1d6598c2 (diff)
downloadcpython-2bca9deecb7f8dd138a37b60bfb1724e213a5fed.zip
cpython-2bca9deecb7f8dd138a37b60bfb1724e213a5fed.tar.gz
cpython-2bca9deecb7f8dd138a37b60bfb1724e213a5fed.tar.bz2
tkinter.Text.debug() now always returns 0/1.
Fixed regression inroduced in issue #6157.
-rw-r--r--Lib/lib-tk/Tkinter.py2
-rw-r--r--Lib/lib-tk/test/test_tkinter/test_text.py5
2 files changed, 3 insertions, 4 deletions
diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
index 0da6cfc..18b5c96 100644
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -2921,7 +2921,7 @@ class Text(Widget, XView, YView):
"""Turn on the internal consistency checks of the B-Tree inside the text
widget according to BOOLEAN."""
if boolean is None:
- return self.tk.call(self._w, 'debug')
+ return self.tk.getboolean(self.tk.call(self._w, 'debug'))
self.tk.call(self._w, 'debug', boolean)
def delete(self, index1, index2=None):
"""Delete the characters between INDEX1 and INDEX2 (not included)."""
diff --git a/Lib/lib-tk/test/test_tkinter/test_text.py b/Lib/lib-tk/test/test_tkinter/test_text.py
index 5a6a6f2..ca21b60 100644
--- a/Lib/lib-tk/test/test_tkinter/test_text.py
+++ b/Lib/lib-tk/test/test_tkinter/test_text.py
@@ -16,13 +16,12 @@ class TextTest(unittest.TestCase):
def test_debug(self):
text = self.text
- wantobjects = self.root.wantobjects()
olddebug = text.debug()
try:
text.debug(0)
- self.assertEqual(text.debug(), 0 if wantobjects else '0')
+ self.assertEqual(text.debug(), 0)
text.debug(1)
- self.assertEqual(text.debug(), 1 if wantobjects else '1')
+ self.assertEqual(text.debug(), 1)
finally:
text.debug(olddebug)
self.assertEqual(text.debug(), olddebug)