better error checking

This commit is contained in:
Maximilian Keßler 2022-02-09 15:39:36 +01:00
parent c2e2a3fad5
commit 5c244f2680

View file

@ -169,10 +169,11 @@ class PyTeXFormatter(FormatterIF, ABC):
@property @property
def raw_name(self) -> str: def raw_name(self) -> str:
try: parts = self._input_file.name.split('.', maxsplit=1)
return self._input_file.name.split('.', maxsplit=1)[0] if not len(parts) == 2:
except: raise NotImplementedError # invalid file name
raise NotImplementedError else:
return parts[0]
@property @property
def name(self): def name(self):