完成 Ruff 全量清理
This commit is contained in:
@@ -137,7 +137,7 @@ class BaseWhitelistAdapter(ABC):
|
||||
|
||||
return False, f"白名单添加失败,API响应: {resp}"
|
||||
|
||||
except Exception as e:
|
||||
except Exception as e: # noqa: BLE001 外部接口与任务边界需要保留宽泛异常兜底
|
||||
msg = f"白名单同步失败: {e}"
|
||||
logger.error(msg)
|
||||
return False, msg
|
||||
@@ -165,7 +165,8 @@ def _get_local_exit_ip() -> str | None:
|
||||
match = re.search(r"(\d{1,3}(?:\.\d{1,3}){3})", text)
|
||||
if match:
|
||||
return match.group(1)
|
||||
except Exception:
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.debug(f"本机出口 IP 查询失败: {url}: {exc}")
|
||||
continue
|
||||
return None
|
||||
|
||||
@@ -197,6 +198,7 @@ def get_exit_ip_via_proxy(proxy: str) -> str | None:
|
||||
match = re.search(r"(\d{1,3}(?:\.\d{1,3}){3})", text)
|
||||
if match:
|
||||
return match.group(1)
|
||||
except Exception:
|
||||
except Exception as exc: # noqa: BLE001
|
||||
logger.debug(f"代理出口 IP 查询失败: {url}: {exc}")
|
||||
continue
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user