From 002dfbc5e9bd26f2b6877505fc586a95cbcf3c30 Mon Sep 17 00:00:00 2001 From: Skyler Grey Date: Tue, 17 Sep 2024 12:53:20 +0000 Subject: [PATCH] fix(aiohttp): Prevent double access of .json Previously both the `request` and `search` methods called `await r.json()`, leading to the `search` method calling `.json()` on a dictionary. This caused the following error: `'dict' object has no attribute 'json'` --- google_custom_search/adapter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google_custom_search/adapter.py b/google_custom_search/adapter.py index 53ed100..1293d36 100644 --- a/google_custom_search/adapter.py +++ b/google_custom_search/adapter.py @@ -107,4 +107,4 @@ async def search(self, *args, **kwargs) -> List[Item]: r = await self.request( "GET", "/", params=self._payload_maker(*args, **kwargs) ) - return self._from_dict(await r.json()) + return self._from_dict(r)