From 66ab59de3a77c689c04fcd93530cbb05d12cd0f0 Mon Sep 17 00:00:00 2001 From: AIAmber Date: Wed, 4 Aug 2021 11:56:32 +0800 Subject: [PATCH] v0.8.3 bug fix4: test endpoint. pylint bug fix3 1.pylint bug fix3 --- src/wechaty_puppet_service/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/wechaty_puppet_service/utils.py b/src/wechaty_puppet_service/utils.py index cde7eae..5428d1e 100644 --- a/src/wechaty_puppet_service/utils.py +++ b/src/wechaty_puppet_service/utils.py @@ -21,9 +21,11 @@ from __future__ import annotations from telnetlib import Telnet -from ping3 import ping + +import socket from logging import Logger from typing import Optional, Tuple +from ping3 import ping from wechaty_puppet.exceptions import WechatyPuppetConfigurationError # type: ignore @@ -61,7 +63,7 @@ def test_endpoint(end_point: str, log: Logger) -> int: else: try: tn.open(host, port=port) - except Exception as e: + except socket.error as e: log.error(e) res = False return res