From f64754a89894fa40f34570c15dd1cd2afcbfdbfa Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Tue, 25 May 2021 14:54:11 -0700 Subject: [PATCH] pybind/argparse: handle None sequence Signed-off-by: Yehuda Sadeh --- src/pybind/ceph_argparse.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/ceph_argparse.py b/src/pybind/ceph_argparse.py index d24b8f8daa49a..b4aace3dfb80a 100644 --- a/src/pybind/ceph_argparse.py +++ b/src/pybind/ceph_argparse.py @@ -218,6 +218,8 @@ class CephArgtype(object): orig_type = get_origin(tp) type_args = get_args(tp) if orig_type in (abc.Sequence, Sequence, List, list): + if v is None: + return None return [CephArgtype.cast_to(type_args[0], e) for e in v] elif orig_type is Tuple: return tuple(CephArgtype.cast_to(type_args[0], e) for e in v) -- 2.39.5