    def _init_asyncio_patch(self):
        """Set default asyncio policy to be compatible with Tornado.

        Tornado 6 (at least) is not compatible with the default
        asyncio implementation on Windows.

        Pick the older SelectorEventLoopPolicy on Windows
        if the known-incompatible default policy is in use.

        Do this as early as possible to make it a low priority and overrideable.

        ref: https://github.com/tornadoweb/tornado/issues/2608

        FIXME: If/when tornado supports the defaults in asyncio,
               remove and bump tornado requirement for py38.
        """
        if sys.platform.startswith("win") and sys.version_info >= (3, 8):
            try:
                from asyncio import (
                    WindowsProactorEventLoopPolicy,
                    WindowsSelectorEventLoopPolicy,
                )
            except ImportError:
                pass
                # not affected
            else:
                if (
                    type(asyncio.get_event_loop_policy())
                    is WindowsProactorEventLoopPolicy
                ):
                    # WindowsProactorEventLoopPolicy is not compatible with Tornado 6.
                    # Fallback to the pre-3.8 default of WindowsSelectorEventLoopPolicy.
                    asyncio.set_event_loop_policy(WindowsSelectorEventLoopPolicy())
Set default asyncio policy to be compatible with Tornado.

Tornado 6 (at least) is not compatible with the default
asyncio implementation on Windows.

Pick the older SelectorEventLoopPolicy on Windows
if the known-incompatible default policy is in use.

Do this as early as possible to make it a low priority and overrideable.

ref: https://github.com/tornadoweb/tornado/issues/2608

FIXME: If/when tornado supports the defaults in asyncio,
remove and bump tornado requirement for py38.
jupyterhub/app.py