diff --git a/pyiron_atomistics/sphinx/parser_base.py b/pyiron_atomistics/sphinx/parser_base.py index 217904c95..e89edb281 100644 --- a/pyiron_atomistics/sphinx/parser_base.py +++ b/pyiron_atomistics/sphinx/parser_base.py @@ -89,12 +89,15 @@ def parse(self, filename): except StopIteration: break self._cleanup(self.keylevels[0]) - if hasattr(self, "finalize"): - self.finalize() + # call optional finalize routine + self.finalize() close(filehandle) # clean up object properties that only exist during parsing del (self.filename, self.line, self.lineno, self.line_from, self.lineview) + def finalize(self): + pass + def location(self): """Return the current parsing location (for error messages)""" return f"in file '{self.filename}' line" + (