remove nested keys from nodes so we do not display garbage

This commit is contained in:
Mike Kinney
2022-01-02 11:15:19 -08:00
parent e7664cb40b
commit a915b05240
3 changed files with 31 additions and 8 deletions

View File

@@ -204,12 +204,18 @@ def support_info():
def remove_keys_from_dict(keys, adict):
"""Return a dictionary without some keys in it."""
newdict = adict
"""Return a dictionary without some keys in it.
Will removed nested keys.
"""
for key in keys:
if key in adict:
del newdict[key]
return newdict
try:
del adict[key]
except:
pass
for val in adict.values():
if isinstance(val, dict):
remove_keys_from_dict(keys, val)
return adict
def hexstr(barray):