aiocontextvars icon indicating copy to clipboard operation
aiocontextvars copied to clipboard

Fix "AttributeError" for Python < 3.5.3 (missing "_get_running_loop()")

Open Delgan opened this issue 6 years ago • 0 comments

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.

Delgan avatar Oct 29 '19 21:10 Delgan