Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
async-promises / compat.py
Size: Mime:
try:
    from asyncio import Future, iscoroutine, ensure_future  # type: ignore
except ImportError:
    class Future:  # type: ignore
        def __init__(self):
            raise Exception("You need asyncio for using Futures")

        def set_result(self):
            raise Exception("You need asyncio for using Futures")

        def set_exception(self):
            raise Exception("You need asyncio for using Futures")

    def ensure_future():  # type: ignore
        raise Exception("ensure_future needs asyncio for executing")

    def iscoroutine(obj):  # type: ignore
        return False

try:
    from .iterate_promise import iterate_promise
except (SyntaxError, ImportError):
    def iterate_promise(promise):
        raise Exception('You need "yield from" syntax for iterate in a Promise.')