From d917f21cd6793d90cb56f72b32ff614668610b38 Mon Sep 17 00:00:00 2001 From: Christian Geier Date: Tue, 7 Nov 2023 16:47:50 +0100 Subject: [PATCH] move type() to isinstance() --- khal/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/khal/utils.py b/khal/utils.py index fae820b20..cee8af8ec 100644 --- a/khal/utils.py +++ b/khal/utils.py @@ -189,7 +189,7 @@ def get_wrapped_text(widget: urwid.AttrMap) -> str: def human_formatter(format_string, width=None, colors=True): """Create a formatter that formats events to be human readable.""" def fmt(rows): - single = type(rows) == dict + single = isinstance(rows, dict) if single: rows = [rows] results = [] @@ -231,7 +231,7 @@ def json_formatter(fields): fields = CONTENT_ATTRIBUTES def fmt(rows): - single = type(rows) == dict + single = isinstance(rows, dict) if single: rows = [rows]