Skip to content

Commit 11076da

Browse files
chore: code style fixes (#425)
1 parent d786fc7 commit 11076da

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

postgrest/_async/request_builder.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ async def execute(self) -> APIResponse[_ReturnT]:
7171
if self.headers.get(
7272
"Accept"
7373
) and "application/vnd.pgrst.plan" in self.headers.get("Accept"):
74-
if not "+json" in self.headers.get("Accept"):
74+
if "+json" not in self.headers.get("Accept"):
7575
return body
7676
return APIResponse[_ReturnT].from_http_request_response(r)
7777
else:
7878
raise APIError(r.json())
7979
except ValidationError as e:
8080
raise APIError(r.json()) from e
81-
except JSONDecodeError as e:
81+
except JSONDecodeError:
8282
raise APIError(generate_default_error_message(r))
8383

8484

@@ -127,7 +127,7 @@ async def execute(self) -> SingleAPIResponse[_ReturnT]:
127127
raise APIError(r.json())
128128
except ValidationError as e:
129129
raise APIError(r.json()) from e
130-
except JSONDecodeError as e:
130+
except JSONDecodeError:
131131
raise APIError(generate_default_error_message(r))
132132

133133

postgrest/_sync/request_builder.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,14 @@ def execute(self) -> APIResponse[_ReturnT]:
7171
if self.headers.get(
7272
"Accept"
7373
) and "application/vnd.pgrst.plan" in self.headers.get("Accept"):
74-
if not "+json" in self.headers.get("Accept"):
74+
if "+json" not in self.headers.get("Accept"):
7575
return body
7676
return APIResponse[_ReturnT].from_http_request_response(r)
7777
else:
7878
raise APIError(r.json())
7979
except ValidationError as e:
8080
raise APIError(r.json()) from e
81-
except JSONDecodeError as e:
81+
except JSONDecodeError:
8282
raise APIError(generate_default_error_message(r))
8383

8484

@@ -127,7 +127,7 @@ def execute(self) -> SingleAPIResponse[_ReturnT]:
127127
raise APIError(r.json())
128128
except ValidationError as e:
129129
raise APIError(r.json()) from e
130-
except JSONDecodeError as e:
130+
except JSONDecodeError:
131131
raise APIError(generate_default_error_message(r))
132132

133133

postgrest/base_request_builder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def from_http_request_response(
196196
) -> Self:
197197
try:
198198
data = request_response.json()
199-
except JSONDecodeError as e:
199+
except JSONDecodeError:
200200
return cls(data=[], count=0)
201201
count = cls._get_count_from_http_request_response(request_response)
202202
# the type-ignore here is as pydantic needs us to pass the type parameter

0 commit comments

Comments
 (0)