[libcamera-devel] [PATCH 19/24] utils: raspberrypi: ctt: Fix pycodestyle E721

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue May 12 02:03:17 CEST 2020


E721 do not compare types, use 'isinstance()'

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
 utils/raspberrypi/ctt/ctt_tools.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/utils/raspberrypi/ctt/ctt_tools.py b/utils/raspberrypi/ctt/ctt_tools.py
index f4b9baac5521..3a2fb4af95c5 100644
--- a/utils/raspberrypi/ctt/ctt_tools.py
+++ b/utils/raspberrypi/ctt/ctt_tools.py
@@ -36,10 +36,10 @@ def get_config(dictt, key, default, ttype):
                 if 'float' not in str(type(val)):
                     raise ValueError
         elif ttype == 'dict':
-            if type(val) != type(dictt):
+            if not isinstance(val, dict):
                 raise ValueError
         elif ttype == 'list':
-            if type(val) != type([]):
+            if not isinstance(val, list):
                 raise ValueError
         elif ttype == 'bool':
             ttype = int(bool(ttype))
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list