# HG changeset patch # User Andrey Skvortsov # Date 1539240075 -10800 # Node ID 1c04a50dc7ffbb3e54739f077f84ffd0c07fb5eb # Parent 922f0d84f869e848d09543b12276ae1b2b5594e5 python3 support: pylint, W1645 # (exception-message-attribute) Exception.message removed in Python 3 diff -r 922f0d84f869 -r 1c04a50dc7ff PLCControler.py --- a/PLCControler.py Wed Oct 10 10:50:00 2018 +0300 +++ b/PLCControler.py Thu Oct 11 09:41:15 2018 +0300 @@ -462,7 +462,7 @@ self.ProgramFilePath = filepath return program_text, errors, warnings except PLCGenException as ex: - errors.append(ex.message) + errors.append(str(ex)) else: errors.append("No project opened") return "", errors, warnings diff -r 922f0d84f869 -r 1c04a50dc7ff PLCGenerator.py --- a/PLCGenerator.py Wed Oct 10 10:50:00 2018 +0300 +++ b/PLCGenerator.py Thu Oct 11 09:41:15 2018 +0300 @@ -1027,7 +1027,7 @@ try: self.GenerateBlock(instance, block_infos, body, None) except ValueError as e: - raise PLCGenException(e.message) + raise PLCGenException(str(e)) elif isinstance(instance, ConnectorClass): connector = instance.getname() if self.ComputedConnectors.get(connector, None): @@ -1305,7 +1305,7 @@ try: paths.append(str(self.GenerateBlock(next, block_infos, body, connection, order, to_inout))) except ValueError as e: - raise PLCGenException(e.message) + raise PLCGenException(str(e)) elif isinstance(next, ContinuationClass): name = next.getname() computed_value = self.ComputedConnectors.get(name, None) diff -r 922f0d84f869 -r 1c04a50dc7ff etherlab/EthercatMaster.py --- a/etherlab/EthercatMaster.py Wed Oct 10 10:50:00 2018 +0300 +++ b/etherlab/EthercatMaster.py Thu Oct 11 09:41:15 2018 +0300 @@ -250,7 +250,7 @@ if error is None: config_is_saved = True except Exception as e: - error = e.message + error = str(e) config_xmlfile.close() if error is not None: @@ -271,7 +271,7 @@ if error is None: process_is_saved = True except Exception as e: - error = e.message + error = str(e) process_xmlfile.close() if error is not None: diff -r 922f0d84f869 -r 1c04a50dc7ff plcopen/plcopen.py --- a/plcopen/plcopen.py Wed Oct 10 10:50:00 2018 +0300 +++ b/plcopen/plcopen.py Thu Oct 11 09:41:15 2018 +0300 @@ -301,7 +301,7 @@ return tree, error except Exception as e: - return None, e.message + return None, str(e) def LoadProject(filepath): diff -r 922f0d84f869 -r 1c04a50dc7ff tests/tools/check_source.sh --- a/tests/tools/check_source.sh Wed Oct 10 10:50:00 2018 +0300 +++ b/tests/tools/check_source.sh Thu Oct 11 09:41:15 2018 +0300 @@ -366,6 +366,7 @@ enable=$enable,W1629 # (nonzero-method) __nonzero__ method defined enable=$enable,W1602 # (basestring-builtin) basestring built-in referenced enable=$enable,W1646 # (invalid-str-codec) non-text encoding used in str.decode + enable=$enable,W1645 # (exception-message-attribute) Exception.message removed in Python 3 # enable= options=