better error checking
This commit is contained in:
parent
c2e2a3fad5
commit
5c244f2680
1 changed files with 5 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue