diff --git a/jira/client.py b/jira/client.py index 66bcc6521..6e9a9fc50 100755 --- a/jira/client.py +++ b/jira/client.py @@ -203,6 +203,11 @@ def __init__(self, server=None, options=None, basic_auth=None, oauth=None, valid globals()['logging'].error("invalid server_info: %s", si) raise e + def __del__(self): + session = getattr(self, "_session", None) + if session is not None: + session.close() + def _check_for_html_error(self, content): # TODO: Make it return errors when content is a webpage with errors # JIRA has the bad habbit of returning errors in pages with 200 and