From 07e872d4db2c32e8f0881ea96a0c2da1a86975ea Mon Sep 17 00:00:00 2001 From: Dmitry Pershin Date: Fri, 15 Dec 2023 18:15:25 +0500 Subject: [PATCH 1/2] aiohttp client uses context manager. --- pjrpc/client/backend/aiohttp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pjrpc/client/backend/aiohttp.py b/pjrpc/client/backend/aiohttp.py index 32319b7..96caa38 100644 --- a/pjrpc/client/backend/aiohttp.py +++ b/pjrpc/client/backend/aiohttp.py @@ -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 From c67209c9251ee49eb76fac5842214ee212819f67 Mon Sep 17 00:00:00 2001 From: Dmitry Pershin Date: Fri, 15 Dec 2023 18:19:23 +0500 Subject: [PATCH 2/2] bump version 1.8.3 --- CHANGELOG.rst | 6 ++++++ pjrpc/__about__.py | 2 +- pyproject.toml | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d599653..827af0f 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,12 @@ Changelog ========= +1.8.3 (2023-12-15) +------------------ + +- aiohttp client uses request context manager. + + 1.8.2 (2023-12-07) ------------------ diff --git a/pjrpc/__about__.py b/pjrpc/__about__.py index 9000699..90909f8 100644 --- a/pjrpc/__about__.py +++ b/pjrpc/__about__.py @@ -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' diff --git a/pyproject.toml b/pyproject.toml index 1bf3679..e1c751c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pjrpc" -version = "1.8.2" +version = "1.8.3" description = "Extensible JSON-RPC library" authors = ["Dmitry Pershin "] license = "Unlicense" @@ -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", ]