# HG changeset patch # User Edouard Tisserant # Date 1538488569 -7200 # Node ID c44692b5373608b299c082f99f9f206a6d48cf0a # Parent 908471b344ba64068f84c8bcfe372e8e085f772c Show more exceptions on stdout, particularly those that are raised by AutoLoad (first item in Main Thread worker) diff -r 908471b344ba -r c44692b53736 runtime/Worker.py --- a/runtime/Worker.py Tue Oct 02 15:52:11 2018 +0200 +++ b/runtime/Worker.py Tue Oct 02 15:56:09 2018 +0200 @@ -8,6 +8,7 @@ # See COPYING.Runtime file for copyrights details. from __future__ import absolute_import +import sys import thread from threading import Lock, Condition @@ -54,8 +55,13 @@ """ self._threadID = thread.get_ident() if args or kwargs: - job(*args, **kwargs).do() - # result is ignored + _job = job(*args, **kwargs) + _job.do() + if _job.success: + # result is ignored + pass + else: + raise _job.exc_info[0], _job.exc_info[1], _job.exc_info[2] self.mutex.acquire() while not self._finish: self.todo.wait() diff -r 908471b344ba -r c44692b53736 runtime/__init__.py --- a/runtime/__init__.py Tue Oct 02 15:52:11 2018 +0200 +++ b/runtime/__init__.py Tue Oct 02 15:56:09 2018 +0200 @@ -23,9 +23,8 @@ exp = sys.exc_info() if _PLCObjectSingleton is not None: _PLCObjectSingleton.LogMessage(0, msg + '\n'.join(traceback.format_exception(*exp))) - else: - print(msg) - traceback.print_exception(*exp) + print(msg) + traceback.print_exception(*exp) def CreatePLCObjectSingleton(*args): global _PLCObjectSingleton