# HG changeset patch # User Andrey Skvortsov # Date 1539332074 -10800 # Node ID 9900a8df922f55b33c95b1711d65b9e983f27500 # Parent 2f2b2152580fe0ee2bfef87b93192802082beb0f python3 support: pylint, W1625 # (raising-string) Raising a string exception diff -r 2f2b2152580f -r 9900a8df922f controls/EnhancedStatusBar.py --- a/controls/EnhancedStatusBar.py Fri Oct 12 10:42:47 2018 +0300 +++ b/controls/EnhancedStatusBar.py Fri Oct 12 11:14:34 2018 +0300 @@ -222,19 +222,20 @@ self._curPos += 1 if self.GetFieldsCount() <= pos: - raise "\nERROR: EnhancedStatusBar has a max of %d items, you tried to set item #%d" % (self.GetFieldsCount(), pos) + raise ValueError("\nERROR: EnhancedStatusBar has a max of %d items, you tried to set item #%d" % + (self.GetFieldsCount(), pos)) if horizontalalignment not in [ESB_ALIGN_CENTER_HORIZONTAL, ESB_EXACT_FIT, ESB_ALIGN_LEFT, ESB_ALIGN_RIGHT]: - raise '\nERROR: Parameter "horizontalalignment" Should Be One Of '\ - '"ESB_ALIGN_CENTER_HORIZONTAL", "ESB_ALIGN_LEFT", "ESB_ALIGN_RIGHT"' \ - '"ESB_EXACT_FIT"' + raise ValueError('\nERROR: Parameter "horizontalalignment" Should Be One Of ' + '"ESB_ALIGN_CENTER_HORIZONTAL", "ESB_ALIGN_LEFT", "ESB_ALIGN_RIGHT"' + '"ESB_EXACT_FIT"') if verticalalignment not in [ESB_ALIGN_CENTER_VERTICAL, ESB_EXACT_FIT, ESB_ALIGN_TOP, ESB_ALIGN_BOTTOM]: - raise '\nERROR: Parameter "verticalalignment" Should Be One Of '\ - '"ESB_ALIGN_CENTER_VERTICAL", "ESB_ALIGN_TOP", "ESB_ALIGN_BOTTOM"' \ - '"ESB_EXACT_FIT"' + raise ValueError('\nERROR: Parameter "verticalalignment" Should Be One Of ' + '"ESB_ALIGN_CENTER_VERTICAL", "ESB_ALIGN_TOP", "ESB_ALIGN_BOTTOM"' + '"ESB_EXACT_FIT"') try: self.RemoveChild(self._items[pos].widget) diff -r 2f2b2152580f -r 9900a8df922f plcopen/structures.py --- a/plcopen/structures.py Fri Oct 12 10:42:47 2018 +0300 +++ b/plcopen/structures.py Fri Oct 12 11:14:34 2018 +0300 @@ -266,7 +266,7 @@ Function_decl_copy = Function_decl.copy() Current_section["list"].append(Function_decl_copy) else: - raise "First function must be in a category" + raise ValueError("First function must be in a category") return Standard_Functions_Decl diff -r 2f2b2152580f -r 9900a8df922f tests/tools/check_source.sh --- a/tests/tools/check_source.sh Fri Oct 12 10:42:47 2018 +0300 +++ b/tests/tools/check_source.sh Fri Oct 12 11:14:34 2018 +0300 @@ -371,6 +371,7 @@ enable=$enable,W1652 # (deprecated-types-field) Accessing a deprecated fields on the types module enable=$enable,W1611 # (standarderror-builtin) StandardError built-in referenced enable=$enable,W1624 # (indexing-exception) Indexing exceptions will not work on Python 3 + enable=$enable,W1625 # (raising-string) Raising a string exception # enable= options=