doc/_ext: use iterator of tuple to build dict

As suggested by Ernesto Puerta <epuertat@redhat.com>

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-01-14 20:17:59 +08:00
parent 2c3e1926de
commit 620e318b2e

View File

@ -162,8 +162,8 @@ class Sig:
@staticmethod
def _parse_arg_desc(desc):
try:
return {kv.split('=')[0]: kv.split('=')[1] for kv in desc.split(',') if kv}
except IndexError:
return dict(kv.split('=') for kv in desc.split(',') if kv)
except ValueError:
return desc
@staticmethod