$43 GRAYBYTE WORDPRESS FILE MANAGER $27

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/lib64/python2.7/site-packages/sqlalchemy/util/

HOME
Current File : /lib64/python2.7/site-packages/sqlalchemy/util//_compat_py3k.py
# util/_compat_py3k.py
# Copyright (C) 2005-2024 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: https://www.opensource.org/licenses/mit-license.php

from functools import wraps

# vendored from py3.7


class _AsyncGeneratorContextManager:
    """Helper for @asynccontextmanager."""

    def __init__(self, func, args, kwds):
        self.gen = func(*args, **kwds)
        self.func, self.args, self.kwds = func, args, kwds
        doc = getattr(func, "__doc__", None)
        if doc is None:
            doc = type(self).__doc__
        self.__doc__ = doc

    async def __aenter__(self):
        try:
            return await self.gen.__anext__()
        except StopAsyncIteration:
            raise RuntimeError("generator didn't yield") from None

    async def __aexit__(self, typ, value, traceback):
        if typ is None:
            try:
                await self.gen.__anext__()
            except StopAsyncIteration:
                return
            else:
                raise RuntimeError("generator didn't stop")
        else:
            if value is None:
                value = typ()
            # See _GeneratorContextManager.__exit__ for comments on subtleties
            # in this implementation
            try:
                await self.gen.athrow(typ, value, traceback)
                raise RuntimeError("generator didn't stop after athrow()")
            except StopAsyncIteration as exc:
                return exc is not value
            except RuntimeError as exc:
                if exc is value:
                    return False
                if isinstance(value, (StopIteration, StopAsyncIteration)):
                    if exc.__cause__ is value:
                        return False
                raise
            except BaseException as exc:
                if exc is not value:
                    raise


# using the vendored version in all cases at the moment to establish
# full test coverage
def asynccontextmanager(func):
    @wraps(func)
    def helper(*args, **kwds):
        return _AsyncGeneratorContextManager(func, args, kwds)

    return helper

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
23 Sep 2024 10.41 AM
root / root
0755
__init__.py
6.302 KB
5 Sep 2024 10.50 PM
root / root
0644
__init__.pyc
7.756 KB
23 Sep 2024 10.41 AM
root / root
0644
_collections.py
28.456 KB
5 Sep 2024 10.50 PM
root / root
0644
_collections.pyc
47.026 KB
23 Sep 2024 10.41 AM
root / root
0644
_compat_py3k.py
2.144 KB
5 Sep 2024 10.50 PM
root / root
0644
_concurrency_py3k.py
6.395 KB
5 Sep 2024 10.50 PM
root / root
0644
_preloaded.py
2.34 KB
5 Sep 2024 10.50 PM
root / root
0644
_preloaded.pyc
2.892 KB
23 Sep 2024 10.41 AM
root / root
0644
compat.py
17.954 KB
5 Sep 2024 10.50 PM
root / root
0644
compat.pyc
21.016 KB
23 Sep 2024 10.41 AM
root / root
0644
concurrency.py
2.225 KB
5 Sep 2024 10.50 PM
root / root
0644
concurrency.pyc
2.472 KB
23 Sep 2024 10.41 AM
root / root
0644
deprecations.py
13.354 KB
5 Sep 2024 10.50 PM
root / root
0644
deprecations.pyc
12.528 KB
23 Sep 2024 10.41 AM
root / root
0644
langhelpers.py
54.969 KB
5 Sep 2024 10.50 PM
root / root
0644
langhelpers.pyc
60.869 KB
23 Sep 2024 10.41 AM
root / root
0644
queue.py
9.075 KB
5 Sep 2024 10.50 PM
root / root
0644
queue.pyc
10.05 KB
23 Sep 2024 10.41 AM
root / root
0644
tool_support.py
5.991 KB
5 Sep 2024 10.50 PM
root / root
0644
topological.py
2.792 KB
5 Sep 2024 10.50 PM
root / root
0644
topological.pyc
2.474 KB
23 Sep 2024 10.41 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF