diff --git a/coc/__init__.py b/coc/__init__.py index 4a0b59c5..44a1ac98 100644 --- a/coc/__init__.py +++ b/coc/__init__.py @@ -22,7 +22,7 @@ SOFTWARE. """ -__version__ = "3.3.0" +__version__ = "3.3.1" from .abc import BasePlayer, BaseClan from .clans import RankedClan, Clan diff --git a/coc/http.py b/coc/http.py index 4cfc4b44..3bc06e8f 100644 --- a/coc/http.py +++ b/coc/http.py @@ -353,6 +353,9 @@ async def request(self, route, **kwargs): await asyncio.sleep(tries * 2 + 1) continue + # catch any stray status codes + raise HTTPException(response, data) + except asyncio.TimeoutError: # api timed out, retry again if tries > 3: @@ -360,7 +363,6 @@ async def request(self, route, **kwargs): await asyncio.sleep(tries * 2 + 1) continue - raise else: if response.status in (500, 502, 504): diff --git a/docs/conf.py b/docs/conf.py index 28ab5b57..c4f5fce8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -15,7 +15,7 @@ project = 'coc' copyright = '2022, mathsman5133' author = 'mathsman5133' -release = '3.3.0' +release = '3.3.1' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/docs/miscellaneous/changelog.rst b/docs/miscellaneous/changelog.rst index 397814c9..6570f350 100644 --- a/docs/miscellaneous/changelog.rst +++ b/docs/miscellaneous/changelog.rst @@ -7,6 +7,14 @@ Changelog This page keeps a fairly detailed, human readable version of what has changed, and whats new for each version of the lib. +v3.3.1 +------ + +Bugs Fixed: +~~~~~~~~~~~ +- Fixed a behaviour where in some cases (when the API responds with an unusual status code), coc.py would not + properly raise an :class:`HTTPException` + v3.3.0 ------ diff --git a/pyproject.toml b/pyproject.toml index 3affe935..f4af0e1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "coc.py" authors = [{ name = "mathsman5133" }] maintainers = [{ name = "majordoobie" }, { name = "MagicTheDev" }, { name = "Kuchenmampfer" }, { name = "lukasthaler"}, { name = "doluk"}] -version = "3.3.0" +version = "3.3.1" description = "A python wrapper for the Clash of Clans API" requires-python = ">=3.7.3" readme = "README.rst"