aiocontextvars
aiocontextvars copied to clipboard
Fix "AttributeError" for Python < 3.5.3 (missing "_get_running_loop()")
Hi @fantix.
As discussed in #88, some earlier versions of Python are missing the _get_running_loop() used to implement the contextvars backport.
It seems complicated to properly fix it. What are your thoughts on just defaulting to _state (threading.local()) in that case?
Currently, using aiocontextvars with Python 3.5.2 (which is common on some Linux distributions) will cause an AttributeError. This "fix" would prevent errors in libraries relying on aiocontextvars for Python < 3.7.