Commits

Serhiy Storchaka committed e7d922d Merge

tkinter.Text.debug() now always returns 0/1.
Fixed a regression inroduced in issue #6157.

  • Participants
  • Parent commits a5b9ae8, 05e84d3

Comments (0)

Files changed (2)

File Lib/tkinter/__init__.py

         """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)."""

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

 
     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)