From 15af1c0017f44d9328d2caafd3571886e1745cfb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Oct 2024 13:26:57 +1000 Subject: [PATCH] tools: change direct type check to isinstance Part-of: --- tools/libinput-measure-touchpad-pressure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libinput-measure-touchpad-pressure.py b/tools/libinput-measure-touchpad-pressure.py index 24ab69e0..6242fb51 100755 --- a/tools/libinput-measure-touchpad-pressure.py +++ b/tools/libinput-measure-touchpad-pressure.py @@ -66,10 +66,10 @@ class TableFormatter(object): s = "|" for w, arg in zip(self.colwidths, args): w -= 1 # width includes | separator - if type(arg) == str: + if isinstance(arg, str): # We want space margins for strings s += " {:{width}s} |".format(arg, width=w - 2) - elif type(arg) == bool: + elif isinstance(arg, bool): s += "{:^{width}s}|".format("x" if arg else " ", width=w) else: s += "{:^{width}d}|".format(arg, width=w) -- 2.34.1