2015-01-31 | Paul Boddie | raw files shortlog changelog graph | Raise a ParseError upon parsing ill-formed files. | |
vContent.py (file) |
1.1 --- a/vContent.py Sat Jan 31 22:59:45 2015 +0100 1.2 +++ b/vContent.py Sat Jan 31 23:00:27 2015 +0100 1.3 @@ -454,7 +454,10 @@ 1.4 "Parse the contents of the file 'f'." 1.5 1.6 ParserBase.parse(self, f, parser_cls) 1.7 - return self.components[0] 1.8 + try: 1.9 + return self.components[0] 1.10 + except IndexError: 1.11 + raise ParseError, "No vContent component found in file." 1.12 1.13 # Writer classes. 1.14