er__ aexit = type(manager).__aexit__ value = await aenter(manager) hit_except = False try: TARGET = value SUITE except: hit_except = True if not await aexit(manager, *sys.exc_info()): raise finally: if not hit_except: await aexit(manager, None, None, None) See also "__aenter__()" and "__aexit__()" for details. It is a "SyntaxError" to use an "async with" statement outside the body of a coroutine function. See also: **PEP 492** - Coroutines with async and await syntax The proposal that made coroutines a proper standalone concept in Python, and added supporting syntax. z