Guido van Rossum added the comment: To create a new event loop, use set_event_loop(new_event_loop()). You have to do that if you want an event loop in a thread; it's also handy in unit tests. (However asyncio's own unit tests only call new_event_loop() and pass it around explicitly with loop=...; they set the default event loop to None with set_event_loop(None).)
Creating a second event loop (in the same thread) while you already have an event loop is fraught with problems -- while the second one is running any events associated with the first one won't fire. (This API is not random -- it is intentionally restricted to allow certain platform event loops to be adapted.) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19860> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com