def close(self):
"""
Cleanup.
"""
for chunk in self.chunks:
self.close_chunk(chunk)
# Workaround: pycurl segfaults when closing multi, that never had
# any curl handles
if hasattr(self, 'manager'):
with closing(pycurl.Curl()) as c:
self.__manager.add_handle(c)
self.__manager.remove_handle(c)
self.chunks = []
if hasattr(self, 'manager'):
self.__manager.close()
del self.__manager
if hasattr(self, "info"):
del self.info
评论列表
文章目录