fix(lint): resolve remaining ruff errors and unblock MCP SSE test (#1)
Some checks failed
CI / lint (push) Failing after 2s
CI / typecheck (push) Failing after 1s
CI / test (push) Failing after 1s
CI / Secret scan (gitleaks) (push) Failing after 2s
CI / Security audit (bandit) (push) Failing after 2s

This commit is contained in:
Crypto Rug Munch 2026-07-02 23:18:40 +02:00
parent a7c30b12cd
commit 98eebe62bf
17 changed files with 60 additions and 87 deletions

View file

@ -10,17 +10,17 @@ for Playwright that focuses on stealth."""
# Licensed under Business Source License 1.1 — see LICENSE-BSL-STEALTH.
# Change Date: 2029-01-01 (converts to MIT).
import contextlib
import logging
import random
import time
from typing import Any
from typing import Any, ClassVar
logger = logging.getLogger(__name__)
# Check for camoufox
try:
from camoufox import AsyncCamoufox
from camoufox.utils import DefaultAddons
_has_camoufox = True
except ImportError:
@ -30,7 +30,7 @@ except ImportError:
class CamoufoxBrowser:
"""Anti-detection Firefox browser using Camoufox."""
DEFAULT_CONFIGS = {
DEFAULT_CONFIGS: ClassVar[dict[str, dict[str, Any]]] = {
"chrome_windows": {
"headless": True,
"os": "windows",
@ -108,10 +108,8 @@ class CamoufoxBrowser:
await page.context.add_cookies([cookie])
await page.goto(url, wait_until="domcontentloaded")
if wait_selector:
try:
with contextlib.suppress(Exception):
await page.wait_for_selector(wait_selector, timeout=wait_time)
except Exception: # noqa: BLE001
pass
else:
await page.wait_for_timeout(wait_time)
content = await page.content()