# HG changeset patch # User Andrey Skvortsov # Date 1538397361 -10800 # Node ID 7fad75e5e63def71b695324186a2ccfad7f43105 # Parent 803daf19a1b54b1953e2ca2dd0531aa64b590f05 cleanup: pylint, R1701 # (consider-merging-isinstance) Consider merging these isinstance calls to isinstance(CTNLDFLAGS, (str, unicode)) diff -r 803daf19a1b5 -r 7fad75e5e63d ConfigTreeNode.py --- 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): diff -r 803daf19a1b5 -r 7fad75e5e63d editors/SFCViewer.py --- 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: diff -r 803daf19a1b5 -r 7fad75e5e63d tests/tools/check_source.sh --- 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'