commit | 7fca85b42ce9591ede9fa7c3c93a9335e0fd0fe3 | [log] [tgz] |
---|---|---|
author | Harald Welte <laforge@osmocom.org> | Sat May 29 21:27:46 2021 +0200 |
committer | Harald Welte <laforge@osmocom.org> | Sat Jun 05 10:47:17 2021 +0200 |
tree | 36cd06965ff3a65ad7b36fbb99ec258397fa3f55 | |
parent | f0885b1042fb89dcbe0fdddf6ada78ca1fabb72a [diff] [blame] |
utils: Make filter_dict() transparently pass non-dict Change-Id: Ia1802101a62e21f1ce894d80728f939bf3da5a39
diff --git a/pySim/construct.py b/pySim/construct.py index a903305..d0101e3 100644 --- a/pySim/construct.py +++ b/pySim/construct.py
@@ -72,6 +72,8 @@ def filter_dict(d, exclude_prefix='_'): """filter the input dict to ensure no keys starting with 'exclude_prefix' remain.""" + if not isinstance(d, dict): + return d res = {} for (key, value) in d.items(): if key.startswith(exclude_prefix):