Commits

Kirill Simonov committed cb33e33

A single dot is not a float value (fixes #62).

Comments (0)

Files changed (2)

lib/yaml/resolver.py

 
 Resolver.add_implicit_resolver(
         u'tag:yaml.org,2002:float',
-        re.compile(ur'''^(?:[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*(?:[eE][-+][0-9]+)?
+        re.compile(ur'''^(?:[-+]?(?:[0-9][0-9_]*)\.[0-9_]*(?:[eE][-+][0-9]+)?
+                    |\.[0-9_]+(?:[eE][-+][0-9]+)?
                     |[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*
                     |[-+]?\.(?:inf|Inf|INF)
                     |\.(?:nan|NaN|NAN))$''', re.X),

tests/test_errors.py

         self.failUnlessRaises(YAMLError, lambda: self._load_string(invalid_filename))
 
     def _testLoaderSingleErrors(self, test_name, invalid_filename):
-        self._load_single(invalid_filename)
+        #self._load_single(invalid_filename)
         self.failUnlessRaises(YAMLError, lambda: self._load_single(invalid_filename))
 
     def _testEmitterErrors(self, test_name, invalid_filename):