From 4a3656562f161a51f5cb6f0e9ccd271859b78d62 Mon Sep 17 00:00:00 2001 From: Kelly Brazil Date: Wed, 13 Oct 2021 07:26:31 -0600 Subject: [PATCH] del null keys --- jc/parsers/lsusb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/jc/parsers/lsusb.py b/jc/parsers/lsusb.py index dfac38a8..31e9d28b 100644 --- a/jc/parsers/lsusb.py +++ b/jc/parsers/lsusb.py @@ -135,6 +135,12 @@ class _LsUsb(): } } + if line_obj[temp_obj['key']]['value'] is None: + del line_obj[temp_obj['key']]['value'] + + if line_obj[temp_obj['key']]['description'] is None: + del line_obj[temp_obj['key']]['description'] + return line_obj def _set_sections(self, line):