Drop redundant hasattr check (#1193)

This commit is contained in:
Tom Christie 2020-08-18 11:24:07 +01:00 committed by GitHub
parent cb620e67c7
commit 9fa95cce6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -956,8 +956,7 @@ class Response:
if not self.is_closed:
self.is_closed = True
self._elapsed = self.request.timer.elapsed
if hasattr(self, "_raw_stream"):
self._raw_stream.close()
self._raw_stream.close()
async def aread(self) -> bytes:
"""
@ -1032,8 +1031,7 @@ class Response:
if not self.is_closed:
self.is_closed = True
self._elapsed = self.request.timer.elapsed
if hasattr(self, "_raw_stream"):
await self._raw_stream.aclose()
await self._raw_stream.aclose()
class Cookies(MutableMapping):