Skip to content

Commit bd4a57d

Browse files
committed
fix: check for empty import_log when writing yaml
Fixes GitHub #8
1 parent 595e048 commit bd4a57d

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

frugy/fru.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ def fmt_tree(part):
142142

143143
def postprocess_yaml(self, data):
144144
result = ''
145-
if len(import_log.str) != 0:
146-
import_log.str = '\n' + import_log.str
147-
for line in [self.comment, *import_log.str.splitlines()]:
148-
result += f'# {line}\n'
145+
if hasattr(import_log, 'str'):
146+
if len(import_log.str) != 0:
147+
import_log.str = '\n' + import_log.str
148+
for line in [self.comment, *import_log.str.splitlines()]:
149+
result += f'# {line}\n'
149150
line_prev = ''
150151
for line in data.splitlines():
151152
if line.endswith(':') and not line.startswith(' '):

0 commit comments

Comments
 (0)