[Python-checkins] cpython (2.7): tkinter.Text.debug() now always returns 0/1.

serhiy.storchaka python-checkins at python.org
Sat Jan 11 12:16:00 CET 2014


http://hg.python.org/cpython/rev/7dab4feec126
changeset:   88409:7dab4feec126
branch:      2.7
parent:      88402:0fab2f9b7edc
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Sat Jan 11 13:12:58 2014 +0200
summary:
  tkinter.Text.debug() now always returns 0/1.
Fixed regression inroduced in issue #6157.

files:
  Lib/lib-tk/Tkinter.py                     |  2 +-
  Lib/lib-tk/test/test_tkinter/test_text.py |  5 ++---
  2 files changed, 3 insertions(+), 4 deletions(-)


diff --git a/Lib/lib-tk/Tkinter.py b/Lib/lib-tk/Tkinter.py
--- a/Lib/lib-tk/Tkinter.py
+++ b/Lib/lib-tk/Tkinter.py
@@ -2921,7 +2921,7 @@
         """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
--- a/Lib/lib-tk/test/test_tkinter/test_text.py
+++ b/Lib/lib-tk/test/test_tkinter/test_text.py
@@ -16,13 +16,12 @@
 
     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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list