diff --git a/keymapviz/__init__.py b/keymapviz/__init__.py index 0b5b126..ffa59ac 100644 --- a/keymapviz/__init__.py +++ b/keymapviz/__init__.py @@ -103,7 +103,7 @@ def __legends(self, keymap): def __json_format(self, json_, keymap): legends = self.__legends(keymap) ret = [[_.format(*legends) if isinstance(_, str) else _ for _ in __] - for __ in json_] + if isinstance(__, list) else __ for __ in json_] with io.StringIO() as sio: json.dump(ret, sio, indent=4) ret_str = sio.getvalue()