This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sublime | |
| import sublime_plugin | |
| try: | |
| import sublime_aio | |
| except: | |
| sublime_aio = None | |
| import sys | |
| from contextvars import Context |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class WithLoop: | |
| def __init__(self, loop: asyncio.AbstractEventLoop): | |
| self._loop = loop | |
| self._prev_loop: Optional[asyncio.AbstractEventLoop] = None | |
| def __enter__(self) -> Self: | |
| self._prev_loop = asyncio._get_running_loop() | |
| asyncio._set_running_loop(self._loop) | |
| return self |