Skip to content

Commit

Permalink
updated to be more pythonic
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Horton <[email protected]>
  • Loading branch information
madpah committed Mar 24, 2022
1 parent ba0c82f commit a1bbf00
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions cyclonedx/output/json.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ def _recurse_specialise_component(self, bom_json: Dict[Any, Any], base_key: str
if not self.component_supports_author() and 'author' in bom_json[base_key][i].keys():
del bom_json[base_key][i]['author']

if self.component_version_optional() and 'version' in bom_json[base_key][i].keys() and \
bom_json[base_key][i]['version'] == "":
if self.component_version_optional() and bom_json[base_key][i].get('version', '') == "":
del bom_json[base_key][i]['version']

if not self.component_supports_pedigree() and 'pedigree' in bom_json[base_key][i].keys():
Expand Down

0 comments on commit a1bbf00

Please sign in to comment.