Skip to content

Commit 7f662c1

Browse files
Merge pull request #3182 from VWS-Python/chore/revert-getattr-workarounds
Revert getattr workarounds to getattr with pylint disables
2 parents 620d9bc + 481ae5f commit 7f662c1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/mock_vws/_requests_mock_server/decorators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ def wrapped(
160160
# req_kwargs is added dynamically by the responses
161161
# library onto PreparedRequest objects - it is not
162162
# in the requests type stubs.
163-
req_kwargs: dict[str, Any] = request.__dict__.get(
163+
req_kwargs: dict[str, Any] = getattr( # pylint: disable=bad-builtin
164+
request,
164165
"req_kwargs",
165166
{},
166167
)
@@ -224,7 +225,7 @@ def __enter__(self) -> Self:
224225
compiled_url_pattern = re.compile(pattern=url_pattern)
225226

226227
for http_method in route.http_methods:
227-
original_callback = object.__getattribute__(
228+
original_callback = getattr( # pylint: disable=bad-builtin
228229
api,
229230
route.route_name,
230231
)

src/mock_vws/_respx_mock_server/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def start_respx_router(
161161
compiled_url_pattern = re.compile(pattern=url_pattern)
162162

163163
for http_method in route.http_methods:
164-
original_callback = object.__getattribute__(
164+
original_callback = getattr( # pylint: disable=bad-builtin
165165
api,
166166
route.route_name,
167167
)

0 commit comments

Comments
 (0)