From a520be5347b2a1e6e77ec2ded363a576d3134c28 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin <jchris.fillionr@kitware.com> Date: Sat, 21 Oct 2017 22:07:17 -0400 Subject: [PATCH] STYLE: src/Python: Fix "do not compare types, use 'isinstance()'" issue See https://www.python.org/dev/peps/pep-0290/#id23 Former-commit-id: ce86ea30669b72c1fe192e0c115ff95e671cf809 --- .flake8 | 2 -- src/Python/Utilities/LUTUtilities.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.flake8 b/.flake8 index 8359795762f..84540e49125 100644 --- a/.flake8 +++ b/.flake8 @@ -1,8 +1,6 @@ [flake8] max-line-length = 150 ignore = - # E721 do not compare types, use 'isinstance()' - E721, # F403 'from numpy import *' used; unable to detect undefined names F403, # F403 'from vtk import *' used; unable to detect undefined names diff --git a/src/Python/Utilities/LUTUtilities.py b/src/Python/Utilities/LUTUtilities.py index bf9b85a6fc1..bfd7373cffc 100755 --- a/src/Python/Utilities/LUTUtilities.py +++ b/src/Python/Utilities/LUTUtilities.py @@ -154,7 +154,7 @@ class LUTUtilities(object): ''' if len(rgba1) != len(rgba2): return False - if type(rgba1) == type(''): + if isinstance(rgba1, str): return rgba1 == rgba2 if len(rgba1) == 3 or len(rgba1) == 4: for i in range(0, len(rgba1)): -- GitLab