diff options
Diffstat (limited to 'lib/sqlalchemy/util/concurrency.py')
-rw-r--r-- | lib/sqlalchemy/util/concurrency.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/sqlalchemy/util/concurrency.py b/lib/sqlalchemy/util/concurrency.py index e5183a542..57ef23006 100644 --- a/lib/sqlalchemy/util/concurrency.py +++ b/lib/sqlalchemy/util/concurrency.py @@ -5,11 +5,12 @@ # This module is part of SQLAlchemy and is released under # the MIT License: https://www.opensource.org/licenses/mit-license.php +import asyncio # noqa have_greenlet = False greenlet_error = None try: - import greenlet # noqa F401 + import greenlet # type: ignore # noqa F401 except ImportError as e: greenlet_error = str(e) pass @@ -24,12 +25,9 @@ else: from ._concurrency_py3k import ( _util_async_run_coroutine_function, ) # noqa F401, E501 - from ._concurrency_py3k import asyncio # noqa F401 if not have_greenlet: - asyncio = None # noqa F811 - def _not_implemented(): # this conditional is to prevent pylance from considering # greenlet_spawn() etc as "no return" and dimming out code below it @@ -46,20 +44,20 @@ if not have_greenlet: def is_exit_exception(e): # noqa F811 return not isinstance(e, Exception) - def await_only(thing): # noqa F811 + def await_only(thing): # type: ignore # noqa F811 _not_implemented() - def await_fallback(thing): # noqa F81 + def await_fallback(thing): # type: ignore # noqa F81 return thing - def greenlet_spawn(fn, *args, **kw): # noqa F81 + def greenlet_spawn(fn, *args, **kw): # type: ignore # noqa F81 _not_implemented() - def AsyncAdaptedLock(*args, **kw): # noqa F81 + def AsyncAdaptedLock(*args, **kw): # type: ignore # noqa F81 _not_implemented() - def _util_async_run(fn, *arg, **kw): # noqa F81 + def _util_async_run(fn, *arg, **kw): # type: ignore # noqa F81 return fn(*arg, **kw) - def _util_async_run_coroutine_function(fn, *arg, **kw): # noqa F81 + def _util_async_run_coroutine_function(fn, *arg, **kw): # type: ignore # noqa F81 _not_implemented() |