diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-09-17 14:34:51 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-09-17 14:34:51 -0400 |
commit | 204fe7ea206a1b0ab4ae248006f99afd15fa7f72 (patch) | |
tree | c612af683bca55c30b977b6361f7164c82019822 /lib/sqlalchemy/dialects/mysql/asyncmy.py | |
parent | 5a0dcb483161eaff473fa8ab1cdfa2fa5c433f10 (diff) | |
download | sqlalchemy-204fe7ea206a1b0ab4ae248006f99afd15fa7f72.tar.gz |
vendor asynccontextmanager
while we still support python 3.6 vendor a simple version
of this for now in the one place we currently use it.
Change-Id: Ibcfc8b004b17e2ac79f9123ccb76c5eb25243f90
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/asyncmy.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/asyncmy.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/asyncmy.py b/lib/sqlalchemy/dialects/mysql/asyncmy.py index f312cf79b..cde43398d 100644 --- a/lib/sqlalchemy/dialects/mysql/asyncmy.py +++ b/lib/sqlalchemy/dialects/mysql/asyncmy.py @@ -28,11 +28,10 @@ This dialect should normally be used only with the """ # noqa -import contextlib - from .pymysql import MySQLDialect_pymysql from ... import pool from ... import util +from ...util.concurrency import asynccontextmanager from ...util.concurrency import asyncio from ...util.concurrency import await_fallback from ...util.concurrency import await_only @@ -188,7 +187,7 @@ class AsyncAdapt_asyncmy_connection: self._execute_mutex = asyncio.Lock() self._ss_cursors = set() - @contextlib.asynccontextmanager + @asynccontextmanager async def _mutex_and_adapt_errors(self): async with self._execute_mutex: try: |