components/python/python27/patches/21-test_tcl.patch
author John Beck <John.Beck@Oracle.COM>
Mon, 06 Oct 2014 13:15:36 -0700
branchs11u2-sru
changeset 3379 e99da14b537a
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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3379
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     1
This patch comes from upstream: http://bugs.python.org/issue21881
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     2
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     3
--- Python-2.7.8/Lib/test/test_tcl.py.~1~	2014-06-29 19:05:37.000000000 -0700
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     4
+++ Python-2.7.8/Lib/test/test_tcl.py	2014-07-17 20:50:53.804037105 -0700
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     5
@@ -420,10 +420,9 @@
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     6
             self.assertEqual(passValue(float('inf')), float('inf'))
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     7
             self.assertEqual(passValue(-float('inf')), -float('inf'))
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     8
         else:
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
     9
-            f = float(passValue(float('nan')))
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    10
-            self.assertNotEqual(f, f)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    11
             self.assertEqual(float(passValue(float('inf'))), float('inf'))
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    12
             self.assertEqual(float(passValue(-float('inf'))), -float('inf'))
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    13
+            # XXX NaN representation can be not parsable by float()
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    14
         self.assertEqual(passValue((1, '2', (3.4,))),
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    15
                          (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    16
 
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    17
@@ -448,9 +447,6 @@
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    18
             expected = float(expected)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    19
             self.assertAlmostEqual(float(actual), expected,
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    20
                                    delta=abs(expected) * 1e-10)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    21
-        def nan_eq(actual, expected):
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    22
-            actual = float(actual)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    23
-            self.assertNotEqual(actual, actual)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    24
 
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    25
         check(True, '1')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    26
         check(False, '0')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    27
@@ -474,7 +470,7 @@
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    28
             check(f, f, eq=float_eq)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    29
         check(float('inf'), 'Inf', eq=float_eq)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    30
         check(-float('inf'), '-Inf', eq=float_eq)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    31
-        check(float('nan'), 'NaN', eq=nan_eq)
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    32
+        # XXX NaN representation can be not parsable by float()
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    33
         check((), '')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    34
         check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
e99da14b537a PSARC 2014/183 Python 2.7.6
John Beck <John.Beck@Oracle.COM>
parents:
diff changeset
    35