cleanup: pylint, R1701 # (consider-merging-isinstance) Consider merging these isinstance calls to isinstance(CTNLDFLAGS, (str, unicode))
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Mon, 01 Oct 2018 15:36:01 +0300
changeset 2414 7fad75e5e63d
parent 2413 803daf19a1b5
child 2415 f7d8891fe708
cleanup: pylint, R1701 # (consider-merging-isinstance) Consider merging these isinstance calls to isinstance(CTNLDFLAGS, (str, unicode))
ConfigTreeNode.py
editors/SFCViewer.py
tests/tools/check_source.sh
--- a/ConfigTreeNode.py	Mon Oct 01 14:29:01 2018 +0300
+++ b/ConfigTreeNode.py	Mon Oct 01 15:36:01 2018 +0300
@@ -277,7 +277,7 @@
         LDFLAGS = []
         if CTNLDFLAGS is not None:
             # LDFLAGS can be either string
-            if isinstance(CTNLDFLAGS, str) or isinstance(CTNLDFLAGS, unicode):
+            if isinstance(CTNLDFLAGS, (str, unicode)):
                 LDFLAGS += [CTNLDFLAGS]
             # or list of strings
             elif isinstance(CTNLDFLAGS, list):
--- a/editors/SFCViewer.py	Mon Oct 01 14:29:01 2018 +0300
+++ b/editors/SFCViewer.py	Mon Oct 01 15:36:01 2018 +0300
@@ -548,7 +548,7 @@
                 dialog.Destroy()
 
     def AddDivergence(self):
-        if self.SelectedElement in self.Wires or isinstance(self.SelectedElement, Graphic_Group) or isinstance(self.SelectedElement, SFC_Step):
+        if self.SelectedElement in self.Wires or isinstance(self.SelectedElement, (Graphic_Group, SFC_Step)):
             dialog = SFCDivergenceDialog(self.ParentWindow, self.Controler, self.TagName)
             dialog.SetPreviewFont(self.GetFont())
             if dialog.ShowModal() == wx.ID_OK:
--- a/tests/tools/check_source.sh	Mon Oct 01 14:29:01 2018 +0300
+++ b/tests/tools/check_source.sh	Mon Oct 01 15:36:01 2018 +0300
@@ -227,6 +227,9 @@
     disable=$disable,W0221        # (arguments-differ) Arguments number differs from overridden 'X' method
     disable=$disable,C0201        # (consider-iterating-dictionary) Consider iterating the dictionary directly instead of calling .keys()
     disable=$disable,W0201        # (attribute-defined-outside-init) Attribute 'X' defined outside __init__
+    disable=$disable,I1101        # (c-extension-no-member) Module 'lxml.etree' has not 'X' member,
+                                  # but source is unavailable. Consider adding this module to extension-pkg-whitelist
+                                  # if you want to perform analysis based on run-time introspection of living objects.
 
     # It'd be nice to fix warnings below some day
     disable=$disable,C0111        # missing-docstring
@@ -292,6 +295,7 @@
     enable=$enable,E1310          # (bad-str-strip-call) Suspicious argument in str.strip call
     enable=$enable,E1300          # (bad-format-character) Unsupported format character '"' (0x22) at index 17
     enable=$enable,E1304          # (missing-format-string-key) Missing key 'X_name' in format string dictionary
+    enable=$enable,R1701          # (consider-merging-isinstance) Consider merging these isinstance calls to isinstance(CTNLDFLAGS, (str, unicode))
     enable=$enable,W0106          # (expression-not-assigned) Expression "X" is assigned to nothing
     enable=$enable,E1136          # (unsubscriptable-object) Value 'X' is unsubscriptable
     enable=$enable,E0602          # (undefined-variable) Undefined variable 'X'