Prevent certain erroring configuration lines from being processed by a later line_ok().

This commit is contained in:
Thomas Hurst 2008-09-02 16:03:08 +01:00
parent e8be0f326c
commit 8fd22efed2

View File

@ -144,12 +144,10 @@ class ConfigFile:
if self._line[self._pos:] != '':
raise ConfigSyntaxError(_("Unexpected token"), self)
self._line_ok()
except ConfigSyntaxError, e:
if self.errors_are_fatal:
raise e
else:
self.errors.append(e)
self._line_error(e)
else:
self._line_ok()
if self.errors:
raise ParsedWithErrors(self.filename, self.errors)
@ -176,3 +174,11 @@ class ConfigFile:
finally:
self._currvalue = None
def _line_error(self, e):
self._currvalue = None
if self.errors_are_fatal:
raise e
else:
self.errors.append(e)