From: Kefu Chai Date: Thu, 14 Jan 2021 12:17:59 +0000 (+0800) Subject: doc/_ext: use iterator of tuple to build dict X-Git-Tag: v16.1.0~20^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=620e318b2ed83d12b8e86c4351128deb4971acf8;p=ceph.git doc/_ext: use iterator of tuple to build dict As suggested by Ernesto Puerta Signed-off-by: Kefu Chai --- diff --git a/doc/_ext/ceph_commands.py b/doc/_ext/ceph_commands.py index 4c91cd83f951..58daba8f1de5 100644 --- a/doc/_ext/ceph_commands.py +++ b/doc/_ext/ceph_commands.py @@ -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