Skip to content

Commit

Permalink
Merge pull request #7 from vmarkovtsev/master
Browse files Browse the repository at this point in the history
Fix ResourceLeak warning with CPython3
  • Loading branch information
ssbarnea committed Jan 14, 2015
2 parents 3557929 + 6113d3b commit 4e59c16
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions jira/client.py
Expand Up @@ -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
Expand Down

0 comments on commit 4e59c16

Please sign in to comment.