Wrap sock.recv in try/execpt to stop failure

This commit is contained in:
Andrew 2022-09-01 10:29:47 -04:00
parent cb1490724c
commit 0bc7e584e0

View File

@ -121,7 +121,10 @@ def ping(ip, port):
i = 0
j = 0
while True:
k = sock.recv(1)
try:
k = sock.recv(1)
except:
return 0
if not k:
return 0
k = k[0]