Merge pull request #260 from hugovk/deprecation-warnings
Close HTTPSConnection in case of exception
This commit is contained in:
commit
a144ce407d
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -47,8 +47,9 @@ htmlcov/
|
|||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*,cover
|
||||
*.cover
|
||||
.hypothesis/
|
||||
.pytest_cache/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
|
|
|
@ -857,7 +857,9 @@ class _Request(object):
|
|||
except Exception as e:
|
||||
raise MalformedResponseError(self.network, e)
|
||||
|
||||
try:
|
||||
self._check_response_for_errors(response_text)
|
||||
finally:
|
||||
conn.close()
|
||||
return response_text
|
||||
|
||||
|
|
4
pytest.ini
Normal file
4
pytest.ini
Normal file
|
@ -0,0 +1,4 @@
|
|||
[pytest]
|
||||
filterwarnings =
|
||||
once::DeprecationWarning
|
||||
once::PendingDeprecationWarning
|
Loading…
Reference in a new issue