Python 3.7.2
In my processing, the main function is wrapped by error interceptors and the interception is performed correctly:
But if an error occurred (and was correctly intercepted!), then the following start of processing fall down on the line:
with error:
In my processing, the main function is wrapped by error interceptors and the interception is performed correctly:
1 2 3 4 5 6 |
try : downloader = Downloader.Downloader() downloader.download() except Exception as err: General.exist_error = True Events.Sender.send_error(err) |
1 |
self .event_exist_data = Event() |
Error:There is no current event loop in thread 'MainThread'
I found the place of the code in which the error occurs (module events):1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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 |