mirror of https://github.com/celery/kombu.git
Fixes warning from amqplib's Transport.__del__
This commit is contained in:
parent
c661f19075
commit
2014371cd4
|
@ -128,6 +128,7 @@ class test_connection_utils(TestCase):
|
|||
virtual_host="/")
|
||||
|
||||
def test_url_IPV6(self):
|
||||
C = BrokerConnection
|
||||
raise SkipTest("urllib can't parse ipv6 urls")
|
||||
|
||||
self.assert_info(
|
||||
|
|
|
@ -35,6 +35,19 @@ DEFAULT_PORT = 5672
|
|||
transport.AMQP_PROTOCOL_HEADER = str_to_bytes("AMQP\x01\x01\x08\x00")
|
||||
|
||||
|
||||
# - fixes warning when socket is not connected.
|
||||
_del = transport._AbstractTransport.__del__
|
||||
for cls in transport.TCPTransport, transport.SSLTransport:
|
||||
class _Transport(cls):
|
||||
|
||||
def __del__(self):
|
||||
try:
|
||||
_del(self)
|
||||
except socket.error:
|
||||
pass
|
||||
setattr(transport, cls.__name__, _Transport)
|
||||
|
||||
|
||||
class Connection(amqp.Connection): # pragma: no cover
|
||||
|
||||
def _do_close(self, *args, **kwargs):
|
||||
|
|
Loading…
Reference in New Issue