Authored by: Grub4k
This commit is contained in:
Simon Sawicki 2024-03-10 16:14:53 +01:00 committed by GitHub
parent 8993721ecb
commit dbd8b1bff9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View File

@ -962,6 +962,7 @@ def __exit__(self, *args):
def close(self): def close(self):
self.save_cookies() self.save_cookies()
if '_request_director' in self.__dict__:
self._request_director.close() self._request_director.close()
del self._request_director del self._request_director

View File

@ -68,7 +68,7 @@ def __init__(self, logger, verbose=False):
def close(self): def close(self):
for handler in self.handlers.values(): for handler in self.handlers.values():
handler.close() handler.close()
self.handlers = {} self.handlers.clear()
def add_handler(self, handler: RequestHandler): def add_handler(self, handler: RequestHandler):
"""Add a handler. If a handler of the same RH_KEY exists, it will overwrite it""" """Add a handler. If a handler of the same RH_KEY exists, it will overwrite it"""