clean-up: fix PEP8 E721 do not compare types, use 'isinstance()'
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Sat, 19 Aug 2017 17:12:12 +0300
changeset 1778 1c6a704bd39c
parent 1777 c46ec818bdd7
child 1779 6cf16e5bfbf9
clean-up: fix PEP8 E721 do not compare types, use 'isinstance()'
ConfigTreeNode.py
--- a/ConfigTreeNode.py	Sat Aug 19 17:04:31 2017 +0300
+++ b/ConfigTreeNode.py	Sat Aug 19 17:12:12 2017 +0300
@@ -276,10 +276,10 @@
         # confnode asks for some LDFLAGS
         if CTNLDFLAGS:
             # LDFLAGS can be either string
-            if type(CTNLDFLAGS) == type(str()):
+            if isinstance(CTNLDFLAGS, str):
                 LDFLAGS = [CTNLDFLAGS]
             # or list of strings
-            elif type(CTNLDFLAGS) == type(list()):
+            elif isinstance(CTNLDFLAGS, list):
                 LDFLAGS = CTNLDFLAGS[:]
         else:
             LDFLAGS = []
@@ -533,7 +533,7 @@
                             format(a1=CTNName, a2=CTNType))
 
         # if CTNClass is a class factory, call it. (prevent unneeded imports)
-        if type(CTNClass) == types.FunctionType:
+        if isinstance(CTNClass, types.FunctionType):
             CTNClass = CTNClass()
 
         # Eventualy Initialize child instance list for this class of confnode