From 753cac25fb1e7e6cd2c742afa8d45ced068ea91d Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Tue, 6 Apr 2021 14:46:27 -0700 Subject: [PATCH] only add description if it exists --- jc/parsers/rpm_qai.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jc/parsers/rpm_qai.py b/jc/parsers/rpm_qai.py index 5b64f303..11778fad 100644 --- a/jc/parsers/rpm_qai.py +++ b/jc/parsers/rpm_qai.py @@ -229,7 +229,8 @@ def parse(data, raw=False, quiet=False): if this_entry != last_entry: if entry_obj: - entry_obj['description'] = ' '.join(description) + if description: + entry_obj['description'] = ' '.join(description) raw_output.append(entry_obj) entry_obj = {} last_entry = this_entry @@ -246,8 +247,10 @@ def parse(data, raw=False, quiet=False): if desc_entry: description.append(line) - entry_obj['description'] = ' '.join(description) - raw_output.append(entry_obj) + if entry_obj: + if description: + entry_obj['description'] = ' '.join(description) + raw_output.append(entry_obj) if raw: return raw_output