Commit 7cd722df authored by Jason Madden's avatar Jason Madden

Try to fix failures on travis ci

parent cde3c239
...@@ -15,7 +15,6 @@ as well as the constants from the :mod:`socket` module are imported into this mo ...@@ -15,7 +15,6 @@ as well as the constants from the :mod:`socket` module are imported into this mo
import sys import sys
from gevent._compat import PY3 from gevent._compat import PY3
from gevent._compat import reraise
from gevent._util import copy_globals from gevent._util import copy_globals
...@@ -75,7 +74,6 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N ...@@ -75,7 +74,6 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
host, port = address host, port = address
err = None err = None
tb = None
for res in getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM): for res in getaddrinfo(host, port, 0 if has_ipv6 else AF_INET, SOCK_STREAM):
af, socktype, proto, _, sa = res af, socktype, proto, _, sa = res
sock = None sock = None
...@@ -92,19 +90,16 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N ...@@ -92,19 +90,16 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
# and the next bind() fails (see test__socket.TestCreateConnection) # and the next bind() fails (see test__socket.TestCreateConnection)
# that does not happen with regular sockets though, because _socket.socket.connect() is a built-in. # that does not happen with regular sockets though, because _socket.socket.connect() is a built-in.
# this is similar to "getnameinfo loses a reference" failure in test_socket.py # this is similar to "getnameinfo loses a reference" failure in test_socket.py
tb = sys.exc_info()[2]
if not PY3: if not PY3:
sys.exc_clear() # pylint:disable=no-member,useless-suppression sys.exc_clear() # pylint:disable=no-member,useless-suppression
if sock is not None: if sock is not None:
sock.close() sock.close()
err = ex err = ex
sock = None
if err is not None: if err is not None:
try: try:
reraise(type(err), err, tb) # pylint:disable=raising-bad-type raise err # pylint:disable=raising-bad-type
finally: finally:
err = None err = None
tb = None
else: else:
raise error("getaddrinfo returns an empty list") raise error("getaddrinfo returns an empty list")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment