diff options
author | Fantix King <fantix.king@gmail.com> | 2020-11-19 11:53:50 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-11-19 14:20:59 -0500 |
commit | 9c7fb63dba0d918e0a6dcba08392759f5b159ee4 (patch) | |
tree | 8ce8500ce8bdc79cb3d88e7f40b217ea68ca8b19 /lib/sqlalchemy/sql/base.py | |
parent | 57ca85de0e81222a1e1b875cdc1df10a1220a330 (diff) | |
download | sqlalchemy-9c7fb63dba0d918e0a6dcba08392759f5b159ee4.tar.gz |
Support PEP-567 context variables
Invoke the given function within a copy of the current PEP-567
context in `greenlet_spawn()`, so that subsequent sync methods could
retrieve the correct context variable.
Adjusted the greenlet integration, which provides support for Python asyncio
in SQLAlchemy, to accommodate for the handling of Python ``contextvars``
(introduced in Python 3.7) for ``greenlet`` versions greater than 0.4.17.
Greenlet version 0.4.17 added automatic handling of contextvars in a
backwards-incompatible way; we've coordinated with the greenlet authors to
add a preferred API for this in versions subsequent to 0.4.17 which is now
supported by SQLAlchemy's greenlet integration. For greenlet versions prior
to 0.4.17 no behavioral change is needed, version 0.4.17 itself is blocked
from the dependencies.
Fixes: #5615
Closes: #5616
Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5616
Pull-request-sha: dcf42f7b78ef3e983fda17f7190cda7b4511e3b4
Change-Id: I378953ee69e1ef2535ba51b97f28cbbbf9de3161
Diffstat (limited to 'lib/sqlalchemy/sql/base.py')
0 files changed, 0 insertions, 0 deletions