Skip to content

Commit

Permalink
Merge pull request #102 from dapper91/dev
Browse files Browse the repository at this point in the history
- aiohttp client uses request context manager.
  • Loading branch information
dapper91 committed Dec 15, 2023
2 parents 0a3300a + c67209c commit badd7eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

1.8.3 (2023-12-15)
------------------

- aiohttp client uses request context manager.


1.8.2 (2023-12-07)
------------------

Expand Down
2 changes: 1 addition & 1 deletion pjrpc/__about__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__description__ = 'Extensible JSON-RPC library'
__url__ = 'https://github.com/dapper91/pjrpc'

__version__ = '1.8.2'
__version__ = '1.8.3'

__author__ = 'Dmitry Pershin'
__email__ = 'dapper1291@gmail.com'
Expand Down
6 changes: 3 additions & 3 deletions pjrpc/client/backend/aiohttp.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ async def _request(self, request_text: str, is_notification: bool = False, **kwa
headers = kwargs.setdefault('headers', {})
headers['Content-Type'] = pjrpc.common.DEFAULT_CONTENT_TYPE

resp = await self._session.post(self._endpoint, data=request_text, **kwargs)
resp.raise_for_status()
async with self._session.post(self._endpoint, data=request_text, **kwargs) as resp:
resp.raise_for_status()
response_text = await resp.text()

response_text = await resp.text()
if is_notification:
return None

Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pjrpc"
version = "1.8.2"
version = "1.8.3"
description = "Extensible JSON-RPC library"
authors = ["Dmitry Pershin <dapper1291@gmail.com>"]
license = "Unlicense"
Expand Down Expand Up @@ -31,6 +31,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]


Expand Down

0 comments on commit badd7eb

Please sign in to comment.