From 620e318b2ed83d12b8e86c4351128deb4971acf8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 14 Jan 2021 20:17:59 +0800 Subject: [PATCH] doc/_ext: use iterator of tuple to build dict As suggested by Ernesto Puerta Signed-off-by: Kefu Chai --- doc/_ext/ceph_commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/_ext/ceph_commands.py b/doc/_ext/ceph_commands.py index 4c91cd83f95..58daba8f1de 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