Skip to content

Commit e93af2a

Browse files
committed
Fixed async context manager protocol
1 parent dab60a8 commit e93af2a

File tree

5 files changed

+4
-2
lines changed

5 files changed

+4
-2
lines changed

CHANGELOG.md

Whitespace-only changes.

CONTRIBUTING.md

Whitespace-only changes.

RELEASE_NOTES.md

Whitespace-only changes.

examples/usage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async def main():
1010
api_token = os.environ.get("VNDB_API_TOKEN") # Keep env var name or change if you prefer
1111

1212
# Using sandbox for this example, set use_sandbox=False for the real API
13-
async with VNDB(api_token=api_token, use_sandbox=True) as vndb: # VNDB class name remains
13+
async with VNDB(api_token=api_token, use_sandbox=False) as vndb:
1414
try:
1515
print("Fetching VNDB Stats:")
1616
stats = await vndb.get_stats()

src/veedb/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,9 @@ def _get_session(self) -> aiohttp.ClientSession:
313313
async def close(self):
314314
if self._session_internal is not None and self._session_owner and not self._session_internal.closed:
315315
await self._session_internal.close()
316-
await asyncio.sleep(0.05) # Allow time for cleanup async def __aenter__(self):
316+
await asyncio.sleep(0.05) # Allow time for cleanup
317+
318+
async def __aenter__(self):
317319
return self
318320

319321
async def __aexit__(self, exc_type, exc_val, exc_tb):

0 commit comments

Comments
 (0)