Skip to content

Instantly share code, notes, and snippets.

View lulle2007200's full-sized avatar
💭
yes

lulle2007200

💭
yes
View GitHub Profile
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
import sublime
import sublime_plugin
try:
import sublime_aio
except:
sublime_aio = None
import sys
from contextvars import Context