Python 3.7.2
In my processing, the main function is wrapped by error interceptors and the interception is performed correctly:
In my processing, the main function is wrapped by error interceptors and the interception is performed correctly:
try:
downloader = Downloader.Downloader()
downloader.download()
except Exception as err:
General.exist_error = True
Events.Sender.send_error(err)But if an error occurred (and was correctly intercepted!), then the following start of processing fall down on the line:self.event_exist_data = Event()with error:
Error:There is no current event loop in thread 'MainThread'I found the place of the code in which the error occurs (module events):class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
...
def get_event_loop(self):
"""Get the event loop.
This may be None or an instance of EventLoop.
"""
if (self._local._loop is None and #TRUE
not self._local._set_called and #FALSE BECAUSE self._local._set_called IS TRUE !!!
isinstance(threading.current_thread(), threading._MainThread)): #TRUE
self.set_event_loop(self.new_event_loop())
if self._local._loop is None:
raise RuntimeError('There is no current event loop in thread %r.' #On the second, third ... iteration I get here!!!
% threading.current_thread().name)
return self._local._loop
