import asyncio


async def call(args, *, cwd, env=None, shell=False):
    """
    Similar to subprocess.call but adapted for asyncio. Please add new arguments as needed.
    cwd is added as an explicit argument because asyncio will not work well with os.chdir, which is not bound to the
    context of the running coroutine.
    """
    create_func = (
        asyncio.create_subprocess_shell if shell else asyncio.create_subprocess_exec
    )
    popenargs = [args] if shell else args
    proc = await create_func(
        *popenargs,
        stdin=None,
        stdout=None,
        stderr=None,
        cwd=cwd,
        env=env,
    )
    return await proc.wait()