donate-cpu: try to catch socket.error better

This commit is contained in:
Daniel Marjamäki 2018-11-20 11:18:18 +01:00
parent 58b3d75b62
commit cba87f913e
1 changed files with 1 additions and 1 deletions

View File

@ -92,8 +92,8 @@ def getPackage():
package = None
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server_address = ('cppcheck.osuosl.org', 8000)
sock.connect(server_address)
try:
sock.connect(server_address)
sock.send(b'get\n')
package = sock.recv(256)
except socket.error: