--- a/connectors/PYRO/PSK_Adapter.py Wed Mar 13 10:02:11 2019 +0300
+++ b/connectors/PYRO/PSK_Adapter.py Wed Mar 13 10:19:30 2019 +0300
@@ -37,7 +37,7 @@
# receive the authentication challenge string, and use that to build the actual identification string.
authChallenge = self.recvAuthChallenge(conn)
- except ProtocolError, x:
+ except ProtocolError as x: # check if we were denied
if hasattr(x, "partialMsg") and x.partialMsg[:len(self.denyMSG)] == self.denyMSG:
raise ConnectionDeniedError(Pyro.constants.deniedReasons[int(x.partialMsg[-1])])
--- a/connectors/PYRO/__init__.py Wed Mar 13 10:02:11 2019 +0300
+++ b/connectors/PYRO/__init__.py Wed Mar 13 10:19:30 2019 +0300
@@ -73,7 +73,7 @@
# Try to get the proxy object
RemotePLCObjectProxy = Pyro.core.getAttrProxyForURI(schemename + "://" + location + "/PLCObject")
confnodesroot.logger.write_error(
_("Connection to {loc} failed with exception {ex}\n").format(
loc=location, exo=str(e)))
--- a/runtime/Worker.py Wed Mar 13 10:02:11 2019 +0300
+++ b/runtime/Worker.py Wed Mar 13 10:19:30 2019 +0300
@@ -51,6 +51,16 @@
self.free = Condition(self.mutex)
+ def reraise(self, job): + reraise exception happend in a job + @param job: job where original exception happend + exc_type = job.exc_info[0] + exc_value = job.exc_info[1] + exc_traceback = job.exc_info[2] + six.reraise(exc_type, exc_value, exc_traceback) def runloop(self, *args, **kwargs):
meant to be called by worker thread (blocking)
@@ -60,11 +70,8 @@
_job = job(*args, **kwargs)
- raise _job.exc_info[0], _job.exc_info[1], _job.exc_info[2]
@@ -106,10 +113,7 @@
- exc_type = _job.exc_info[0]
- exc_value = _job.exc_info[1]
- exc_traceback = _job.exc_info[2]
- six.reraise(exc_type, exc_value, exc_traceback)