diff --git a/postgrest/_async/request_builder.py b/postgrest/_async/request_builder.py index 6349ce91..13df7715 100644 --- a/postgrest/_async/request_builder.py +++ b/postgrest/_async/request_builder.py @@ -71,14 +71,14 @@ async def execute(self) -> APIResponse[_ReturnT]: if self.headers.get( "Accept" ) and "application/vnd.pgrst.plan" in self.headers.get("Accept"): - if not "+json" in self.headers.get("Accept"): + if "+json" not in self.headers.get("Accept"): return body return APIResponse[_ReturnT].from_http_request_response(r) else: raise APIError(r.json()) except ValidationError as e: raise APIError(r.json()) from e - except JSONDecodeError as e: + except JSONDecodeError: raise APIError(generate_default_error_message(r)) @@ -127,7 +127,7 @@ async def execute(self) -> SingleAPIResponse[_ReturnT]: raise APIError(r.json()) except ValidationError as e: raise APIError(r.json()) from e - except JSONDecodeError as e: + except JSONDecodeError: raise APIError(generate_default_error_message(r)) diff --git a/postgrest/_sync/request_builder.py b/postgrest/_sync/request_builder.py index fccff0c4..f713e7d2 100644 --- a/postgrest/_sync/request_builder.py +++ b/postgrest/_sync/request_builder.py @@ -71,14 +71,14 @@ def execute(self) -> APIResponse[_ReturnT]: if self.headers.get( "Accept" ) and "application/vnd.pgrst.plan" in self.headers.get("Accept"): - if not "+json" in self.headers.get("Accept"): + if "+json" not in self.headers.get("Accept"): return body return APIResponse[_ReturnT].from_http_request_response(r) else: raise APIError(r.json()) except ValidationError as e: raise APIError(r.json()) from e - except JSONDecodeError as e: + except JSONDecodeError: raise APIError(generate_default_error_message(r)) @@ -127,7 +127,7 @@ def execute(self) -> SingleAPIResponse[_ReturnT]: raise APIError(r.json()) except ValidationError as e: raise APIError(r.json()) from e - except JSONDecodeError as e: + except JSONDecodeError: raise APIError(generate_default_error_message(r)) diff --git a/postgrest/base_request_builder.py b/postgrest/base_request_builder.py index 3f6b0ff4..8ee7b20f 100644 --- a/postgrest/base_request_builder.py +++ b/postgrest/base_request_builder.py @@ -196,7 +196,7 @@ def from_http_request_response( ) -> Self: try: data = request_response.json() - except JSONDecodeError as e: + except JSONDecodeError: return cls(data=[], count=0) count = cls._get_count_from_http_request_response(request_response) # the type-ignore here is as pydantic needs us to pass the type parameter