mirror of https://github.com/celery/kombu.git
Switch to using getattr in qpid.Transport.__del__ (#658)
The __init__ function calls verify_runtime_environment before setting the use_async_interface variable. If it throws an exception in that function, the __del__ method will be called, and raises an AttributeError using getattr in the __del__ method to guard against this
This commit is contained in:
parent
7e1e06b0f9
commit
82f026eafa
|
@ -1731,7 +1731,7 @@ class Transport(base.Transport):
|
|||
|
||||
def __del__(self):
|
||||
"""Ensure file descriptors opened in __init__() are closed."""
|
||||
if self.use_async_interface:
|
||||
if getattr(self, 'use_async_interface', False):
|
||||
for fd in (self.r, self._w):
|
||||
try:
|
||||
os.close(fd)
|
||||
|
|
Loading…
Reference in New Issue