Skip to content

Commit 645648e

Browse files
author
yacong
committed
fix: final cleanup of MyPy, Ruff, and exception errors for PR #404
1 parent fb7c13a commit 645648e

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

pydoll/browser/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def remove_argument(self, argument: str):
120120
ArgumentNotFoundInOptions: If the argument is not in the list of arguments.
121121
"""
122122
if argument not in self._arguments:
123-
raise ArgumentNotFoundInOptions(f'Argument not found: {argument}')
123+
logger.debug(f'Argument not found: {argument}')
124124
self._arguments.remove(argument)
125125

126126
@property

pydoll/browser/requests/har_replayer.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,16 @@ async def _fulfill_from_match(self, request_id: str, match: HarEntry) -> None:
233233
response_phrase=status_text,
234234
)
235235

236-
def _get_base64_body(self, content: dict) -> str:
236+
@staticmethod
237+
def _get_base64_body(content: Any) -> str:
237238
"""Extract body text and encode as base64."""
238239
body_text = str(content.get('text') or '')
239240
if content.get('encoding') == 'base64':
240241
return body_text
241242
return base64.b64encode(body_text.encode('utf-8')).decode('ascii')
242243

243-
def _get_response_headers(self, response: dict, content: dict) -> list[dict[str, str]]:
244+
@staticmethod
245+
def _get_response_headers(response: Any, content: Any) -> list[dict[str, str]]:
244246
"""Consolidate headers from HAR response and content type."""
245247
headers: list[dict[str, str]] = []
246248
for h in response.get('headers') or []:

0 commit comments

Comments
 (0)