Skip to content

Commit 13759af

Browse files
authored
Merge pull request #6
pylint3
2 parents 073cd56 + 66ab59d commit 13759af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wechaty_puppet_service/utils.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@
2121
from __future__ import annotations
2222

2323
from telnetlib import Telnet
24-
from ping3 import ping
24+
25+
import socket
2526
from logging import Logger
2627
from typing import Optional, Tuple
28+
from ping3 import ping
2729
from wechaty_puppet.exceptions import WechatyPuppetConfigurationError # type: ignore
2830

2931

@@ -61,7 +63,7 @@ def test_endpoint(end_point: str, log: Logger) -> int:
6163
else:
6264
try:
6365
tn.open(host, port=port)
64-
except Exception as e:
66+
except socket.error as e:
6567
log.error(e)
6668
res = False
6769
return res

0 commit comments

Comments
 (0)