Ticket #246: PyYAML-3.10.patch

File PyYAML-3.10.patch, 1.1 KB (added by genericsoma@…, 3 years ago)

resolver patch and test suite update for the ticket

  • lib/yaml/resolver.py

    diff -rupN PyYAML-3.10/lib/yaml/resolver.py PyYAML-3.10.new/lib/yaml/resolver.py
    old new Resolver.add_implicit_resolver( 
    173173 
    174174Resolver.add_implicit_resolver( 
    175175        u'tag:yaml.org,2002:float', 
    176         re.compile(ur'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)? 
    177                     |\.[0-9_]+(?:[eE][-+][0-9]+)? 
     176        re.compile(ur'''^(?:[-+]?(?:[0-9][0-9_]*)(?:\.[0-9_]*)?(?:[eE][-+]?[0-9]+) 
     177                    |(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*) 
     178                    |\.[0-9_]+(?:[eE][-+]?[0-9]+)? 
    178179                    |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]* 
    179180                    |[-+]?\.(?:inf|Inf|INF) 
    180181                    |\.(?:nan|NaN|NAN))$''', re.X), 
  • tests/data/float.data

    diff -rupN PyYAML-3.10/tests/data/float.data PyYAML-3.10.new/tests/data/float.data
    old new  
    11- 6.8523015e+5 
     2- 685e5 
    23- 685.230_15e+03 
    34- 685_230.15 
    45- 190:20:30.15