]> granicus.if.org Git - python/commitdiff
tkinter.Text.debug() now always returns 0/1.
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 11 Jan 2014 11:13:46 +0000 (13:13 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 11 Jan 2014 11:13:46 +0000 (13:13 +0200)
Fixed a regression inroduced in issue #6157.

Lib/tkinter/__init__.py
Lib/tkinter/test/test_tkinter/test_text.py

index 2fdabde9b4aa466aa4f8b2a28758590a9b84094a..2f4cce99e842ce8823c8c0bc0875c581a51811ea 100644 (file)
@@ -3002,7 +3002,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)."""
index db8ae6c265e5956c63963e4617afca037f2cd493..4c3fa04188e023074d1b657539011dea5b9b791b 100644 (file)
@@ -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)