[Python-checkins] cpython (merge 3.4 -> default): Issue #16840: Fixed test_tcl for Tcl < 8.5.

serhiy.storchaka python-checkins at python.org
Thu Apr 2 19:08:10 CEST 2015


https://hg.python.org/cpython/rev/2398dba039f3
changeset:   95397:2398dba039f3
parent:      95394:8ad98ade3f78
parent:      95396:1d2444273b3d
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Thu Apr 02 20:07:24 2015 +0300
summary:
  Issue #16840: Fixed test_tcl for Tcl < 8.5.

files:
  Lib/test/test_tcl.py |  8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -143,7 +143,9 @@
         tcl = self.interp.tk
         for i in self.get_integers():
             self.assertEqual(tcl.getint(' %d ' % i), i)
-            self.assertEqual(tcl.getint(' %#o ' % i), i)
+            if tcl_version >= (8, 5):
+                self.assertEqual(tcl.getint(' %#o ' % i), i)
+            self.assertEqual(tcl.getint((' %#o ' % i).replace('o', '')), i)
             self.assertEqual(tcl.getint(' %#x ' % i), i)
         if tcl_version < (8, 5):  # bignum was added in Tcl 8.5
             self.assertRaises(TclError, tcl.getint, str(2**1000))
@@ -420,9 +422,7 @@
                 self.assertEqual(result, str(i))
                 self.assertIsInstance(result, str)
         if tcl_version < (8, 5):  # bignum was added in Tcl 8.5
-            result = tcl.call('expr', str(2**1000))
-            self.assertEqual(result, str(2**1000))
-            self.assertIsInstance(result, str)
+            self.assertRaises(TclError, tcl.call, 'expr', str(2**1000))
 
     def test_passing_values(self):
         def passValue(value):

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


More information about the Python-checkins mailing list