INNER CODE UNIT · Python

__aenter__

Xeron2000/openOii · backend/aiosqlite/__init__.py:43

    async def __aenter__(self) -> "Cursor":
        return self

    async def __aexit__(self, exc_type, exc, tb) -> None:
        await self.close()

    async def _ensure_cursor(self) -> None:
        await asyncio.sleep(0)
        await self._conn._open()
        if self._cursor is None:
            assert self._conn._conn is not None
            self._cursor = self._conn._conn.cursor()

    async def close(self) -> None:
        await asyncio.sleep(0)
        if self._closed:
            return
        self._closed = True

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…