components/python/python27/patches/21-test_tcl.patch
changeset 2027 cd5205b6221a
equal deleted inserted replaced
2026:60c5e1a7c30e 2027:cd5205b6221a
       
     1 This patch comes from upstream: http://bugs.python.org/issue21881
       
     2 
       
     3 --- Python-2.7.8/Lib/test/test_tcl.py.~1~	2014-06-29 19:05:37.000000000 -0700
       
     4 +++ Python-2.7.8/Lib/test/test_tcl.py	2014-07-17 20:50:53.804037105 -0700
       
     5 @@ -420,10 +420,9 @@
       
     6              self.assertEqual(passValue(float('inf')), float('inf'))
       
     7              self.assertEqual(passValue(-float('inf')), -float('inf'))
       
     8          else:
       
     9 -            f = float(passValue(float('nan')))
       
    10 -            self.assertNotEqual(f, f)
       
    11              self.assertEqual(float(passValue(float('inf'))), float('inf'))
       
    12              self.assertEqual(float(passValue(-float('inf'))), -float('inf'))
       
    13 +            # XXX NaN representation can be not parsable by float()
       
    14          self.assertEqual(passValue((1, '2', (3.4,))),
       
    15                           (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4')
       
    16  
       
    17 @@ -448,9 +447,6 @@
       
    18              expected = float(expected)
       
    19              self.assertAlmostEqual(float(actual), expected,
       
    20                                     delta=abs(expected) * 1e-10)
       
    21 -        def nan_eq(actual, expected):
       
    22 -            actual = float(actual)
       
    23 -            self.assertNotEqual(actual, actual)
       
    24  
       
    25          check(True, '1')
       
    26          check(False, '0')
       
    27 @@ -474,7 +470,7 @@
       
    28              check(f, f, eq=float_eq)
       
    29          check(float('inf'), 'Inf', eq=float_eq)
       
    30          check(-float('inf'), '-Inf', eq=float_eq)
       
    31 -        check(float('nan'), 'NaN', eq=nan_eq)
       
    32 +        # XXX NaN representation can be not parsable by float()
       
    33          check((), '')
       
    34          check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
       
    35