fix socket.error problem

This commit is contained in:
clowwindy 2012-05-12 00:56:42 +08:00
parent 79c3dfb86f
commit 00b2ce3e2e
2 changed files with 2 additions and 2 deletions

View file

@ -54,7 +54,7 @@ def socket_create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
sock.connect(sa)
return sock
except error as _:
except socket.error as _:
err = _
if sock is not None:
sock.close()

View file

@ -57,7 +57,7 @@ def socket_create_connection(address, timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
sock.connect(sa)
return sock
except error as _:
except socket.error as _:
err = _
if sock is not None:
sock.close()