components/python/python27/patches/21-test_tcl.patch
author John Beck <John.Beck@Oracle.COM>
Sat, 04 Oct 2014 14:50:43 -0700
branchs11-update
changeset 3367 ed5024e47b53
permissions -rw-r--r--
PSARC 2014/183 Python 2.7.6 18251953 update Python 2.7 line to version 2.7.6 19004605 update Python 2.7 line to version 2.7.7 19308541 update Python 2.7 line to version 2.7.8 19284990 python 2.7.7 segfaults while under memory stress 17431625 64-bit python should use long rather than int for os.sysconf() return value 19164544 Python 2.7 test_tcl fails 19030238 Python 2.7 test_sysconfig fails - no module named _osx_support 19030198 Python 2.7 tests fail - import name error 19032456 more Python 2.7 tests failing with import errors 19022543 Python 2.7 test_lib2to3 fails

This patch comes from upstream: http://bugs.python.org/issue21881

--- Python-2.7.8/Lib/test/test_tcl.py.~1~	2014-06-29 19:05:37.000000000 -0700
+++ Python-2.7.8/Lib/test/test_tcl.py	2014-07-17 20:50:53.804037105 -0700
@@ -420,10 +420,9 @@
             self.assertEqual(passValue(float('inf')), float('inf'))
             self.assertEqual(passValue(-float('inf')), -float('inf'))
         else:
-            f = float(passValue(float('nan')))
-            self.assertNotEqual(f, f)
             self.assertEqual(float(passValue(float('inf'))), float('inf'))
             self.assertEqual(float(passValue(-float('inf'))), -float('inf'))
+            # XXX NaN representation can be not parsable by float()
         self.assertEqual(passValue((1, '2', (3.4,))),
                          (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4')
 
@@ -448,9 +447,6 @@
             expected = float(expected)
             self.assertAlmostEqual(float(actual), expected,
                                    delta=abs(expected) * 1e-10)
-        def nan_eq(actual, expected):
-            actual = float(actual)
-            self.assertNotEqual(actual, actual)
 
         check(True, '1')
         check(False, '0')
@@ -474,7 +470,7 @@
             check(f, f, eq=float_eq)
         check(float('inf'), 'Inf', eq=float_eq)
         check(-float('inf'), '-Inf', eq=float_eq)
-        check(float('nan'), 'NaN', eq=nan_eq)
+        # XXX NaN representation can be not parsable by float()
         check((), '')
         check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')