handle case when .ftl file doesn't exist yet
This commit is contained in:
parent
92aaaf7146
commit
65acf70df4
@ -46,10 +46,10 @@ def write_entry(fname, key, entry):
|
||||
entry.id.name = key
|
||||
|
||||
if not os.path.exists(fname):
|
||||
return
|
||||
|
||||
with open(fname) as file:
|
||||
orig = file.read()
|
||||
orig = ""
|
||||
else:
|
||||
with open(fname) as file:
|
||||
orig = file.read()
|
||||
obj = parse(orig)
|
||||
for ent in obj.body:
|
||||
if isinstance(ent, Junk):
|
||||
|
Loading…
Reference in New Issue
Block a user