From 1d06e4f074876e5793af4fb7937a6aed615ad4ea Mon Sep 17 00:00:00 2001 From: D0rs4n <41237606+D0rs4n@users.noreply.github.com> Date: Fri, 20 Aug 2021 21:40:36 +0200 Subject: Remove unnecessary variables from the Wikipedia cog --- bot/exts/evergreen/wikipedia.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bot/exts/evergreen/wikipedia.py b/bot/exts/evergreen/wikipedia.py index 9397568d..01c13005 100644 --- a/bot/exts/evergreen/wikipedia.py +++ b/bot/exts/evergreen/wikipedia.py @@ -47,16 +47,16 @@ class WikipediaSearch(commands.Cog): """Search wikipedia search string and return formatted first 10 pages found.""" params = WIKI_PARAMS | {"srlimit": 10, "srsearch": search} async with self.bot.http_session.get(url=SEARCH_API, params=params) as resp: - if (status := resp.status) != 200: - log.info(f"Unexpected response `{status}` while searching wikipedia for `{search}`") - raise APIError("Wikipedia API", status) + if resp.status != 200: + log.info(f"Unexpected response `{resp.status}` while searching wikipedia for `{search}`") + raise APIError("Wikipedia API", resp.status) raw_data = await resp.json() if not raw_data.get("query"): if error := raw_data.get("errors"): log.error(f"There was an error while communicating with the Wikipedia API: {error}") - raise APIError("Wikipedia API", status, error) + raise APIError("Wikipedia API", resp.status, error) lines = [] if raw_data["query"]["searchinfo"]["totalhits"]: -- cgit v1.2.3