William Woodall added the comment:

I was getting the same error as the OP in my application.

I did something like this to work around the problem:

import asyncio
import atexit

def close_asyncio_loop():
    loop = None
    try:
        loop = asyncio.get_event_loop()
    except AttributeError:
        pass
    if loop is not None:
        loop.close()

atexit.register(close_asyncio_loop)

Is this an appropriate work around?

Why is it up to the application to close the loop explicitly?

Put another way, in what scenario would I want to close the loop outside of the 
application shutting down since it is irreversible?

Thanks in advance for your time.

----------
nosy: +wjwwood

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23548>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to