Yury Selivanov added the comment: Looking at the code: we don't need to use iscoroutinefunction at all. If we had separate methods for sync and async context managers, you can store the flag if a function is async or sync along with it.
So _exit_callbacks should store tuples `(is_async, cb)`, instead of just `cb`. asyncio.iscoroutinefunction differs from inspect.iscoroutinefunction a little bit to support asyncio-specific debug coroutine wrapper functions. We should avoid using any version of iscoroutinefunction here. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29302> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com