# HG changeset patch # User Laurent Bessard # Date 1380483433 -7200 # Node ID 1054cb01b523d43b41ddc95fb33a31bb8b0ccb10 # Parent 7f264cc6e75d39713245554a364e0ea89124ace3# Parent 1b9610fc1e6beef46ca5818925fa55bad95bf2e2 Merged diff -r 1b9610fc1e6b -r 1054cb01b523 py_ext/plc_python.c --- a/py_ext/plc_python.c Sun Sep 29 20:39:32 2013 +0200 +++ b/py_ext/plc_python.c Sun Sep 29 21:37:13 2013 +0200 @@ -163,7 +163,6 @@ LockPython(); /* Get current FB */ data__ = EvalFBs[Current_Python_EvalFB]; - *id=data__; if(data__ && /* may be null at first run */ __GET_VAR(data__->STATE) == PYTHON_FB_PROCESSING){ /* some answer awaited*/ /* If result not None */ @@ -209,6 +208,7 @@ __SET_VAR(data__->, BUFFER, 0, .body[__GET_VAR(data__->BUFFER, .len)]); /* next command is BUFFER */ next_command = (char*)__GET_VAR(data__->BUFFER, .body); + *id=data__; /* free python mutex */ UnLockPython(); /* return the next command to eval */ diff -r 1b9610fc1e6b -r 1054cb01b523 runtime/PLCObject.py --- a/runtime/PLCObject.py Sun Sep 29 20:39:32 2013 +0200 +++ b/runtime/PLCObject.py Sun Sep 29 21:37:13 2013 +0200 @@ -329,7 +329,7 @@ if ccmd is None or ccmd!=cmd: AST = compile(cmd, '', 'eval') compile_cache[FBID]=(cmd,AST) - result,exp = self.evaluator(eval,cmd,self.python_runtime_vars) + result,exp = self.evaluator(eval,AST,self.python_runtime_vars) if exp is not None: res = "#EXCEPTION : "+str(exp[1]) self.LogMessage(1,('PyEval@0x%x(Code="%s") Exception "%s"')%(FBID,cmd,