Skip to content

Commit

Permalink
Merge pull request #246 from qarkai/asynccontextmanager
Browse files Browse the repository at this point in the history
Use contextlib.asynccontextmanager
  • Loading branch information
LilSpazJoekp committed Jul 11, 2023
2 parents 4f4b0b4 + 493d4ce commit 55f4fe8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,5 @@ Source Contributors
- Josh Kim `@jsk56143 <https://github.com/jsk56143>`_
- Rolf Campbell `@endlisnis <https://github.com/endlisnis>`_
- zacc `@zacc <https://github.com/zacc>`_
- Arkadiy Illarionov `@qarkai <https://github.com/qarkai>`_
- Add "Name <email (optional)> and github profile link" above this line.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Async PRAW follows `semantic versioning <https://semver.org/>`_.
Unreleased
----------

**Changed**

- Drop asyncio_extras dependency, use contextlib.asynccontextmanager instead.

7.7.0 (2023/02/25)
------------------

Expand Down
4 changes: 2 additions & 2 deletions asyncpraw/util/token_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
"""
from abc import ABC, abstractmethod
from contextlib import asynccontextmanager

import aiofiles
from asyncio_extras import async_contextmanager

from . import _deprecate_args

Expand Down Expand Up @@ -159,7 +159,7 @@ async def close(self):
"""Close the sqlite3 connection."""
await self._connection.close()

@async_contextmanager
@asynccontextmanager
async def connection(self):
"""Asynchronously setup and provide the sqlite3 connection."""
if self._connection is None:
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
"aiofiles <1",
"aiohttp <4",
"aiosqlite <=0.17.0",
"asyncio_extras <=1.3.2",
"asyncprawcore >=2.1, <3",
"update_checker >=0.18",
],
Expand Down

0 comments on commit 55f4fe8

Please sign in to comment.