style(browser): fix pre-existing ruff lints in server.py (RUF100, E501)
Drive-by: browser/server.py was never linted (pre-commit ruff is scoped to backend/), so #909 left an unused noqa + a 101-char line. Cleaned up while editing this file for the proxy fix.
This commit is contained in:
parent
57acec215f
commit
3527a6bc8d
1 changed files with 4 additions and 2 deletions
|
|
@ -87,7 +87,7 @@ async def _launch_browser() -> None:
|
||||||
"""Запускает AsyncCamoufox и сохраняет browser + CM в модульных переменных."""
|
"""Запускает AsyncCamoufox и сохраняет browser + CM в модульных переменных."""
|
||||||
global _browser, _browser_cm, _page_counter
|
global _browser, _browser_cm, _page_counter
|
||||||
|
|
||||||
from camoufox.async_api import AsyncCamoufox # noqa: PLC0415
|
from camoufox.async_api import AsyncCamoufox
|
||||||
|
|
||||||
proxy = _parse_proxy(SCRAPER_PROXY_URL)
|
proxy = _parse_proxy(SCRAPER_PROXY_URL)
|
||||||
kwargs: dict[str, object] = {
|
kwargs: dict[str, object] = {
|
||||||
|
|
@ -180,7 +180,9 @@ async def fetch_handler(request: web.Request) -> web.Response:
|
||||||
try:
|
try:
|
||||||
html = await _do_fetch(url)
|
html = await _do_fetch(url)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.error("tradein-browser: fetch error url=%r: %s: %s", url, type(exc).__name__, exc)
|
logger.error(
|
||||||
|
"tradein-browser: fetch error url=%r: %s: %s", url, type(exc).__name__, exc
|
||||||
|
)
|
||||||
return web.json_response({"error": f"{type(exc).__name__}: {exc}"}, status=500)
|
return web.json_response({"error": f"{type(exc).__name__}: {exc}"}, status=500)
|
||||||
|
|
||||||
return web.json_response({"html": html})
|
return web.json_response({"html": html})
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue