diff --git a/CHANGES/2523.bugfix b/CHANGES/2523.bugfix new file mode 100644 index 00000000000..879ec21b378 --- /dev/null +++ b/CHANGES/2523.bugfix @@ -0,0 +1 @@ +Fix warning in `ClientSession.__del__` by stopping to try to close it. diff --git a/aiohttp/client.py b/aiohttp/client.py index 8bbf0d4c7ef..6a0370fe846 100644 --- a/aiohttp/client.py +++ b/aiohttp/client.py @@ -126,8 +126,6 @@ def __init__(self, *, connector=None, loop=None, cookies=None, def __del__(self, _warnings=warnings): if not self.closed: - self.close() - _warnings.warn("Unclosed client session {!r}".format(self), ResourceWarning) context = {'client_session': self,