From 7fca85b42ce9591ede9fa7c3c93a9335e0fd0fe3 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 29 May 2021 21:27:46 +0200 Subject: [PATCH] utils: Make filter_dict() transparently pass non-dict Change-Id: Ia1802101a62e21f1ce894d80728f939bf3da5a39 --- pySim/construct.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pySim/construct.py b/pySim/construct.py index a9033059..d0101e3e 100644 --- a/pySim/construct.py +++ b/pySim/construct.py @@ -72,6 +72,8 @@ class GsmStringAdapter(Adapter): 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):