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
def raw_name(self) -> str:
try:
return self._input_file.name.split('.', maxsplit=1)[0]
except:
raise NotImplementedError
parts = self._input_file.name.split('.', maxsplit=1)
if not len(parts) == 2:
raise NotImplementedError # invalid file name
else:
return parts[0]
@property
def name(self):