From: Tom Christie Date: Tue, 18 Aug 2020 10:24:07 +0000 (+0100) Subject: Drop redundant hasattr check (#1193) X-Git-Tag: 0.14.2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fa95cce6a5ada0e6bf5bc5e4c4adff1d145f8e7;p=thirdparty%2Fhttpx.git Drop redundant hasattr check (#1193) --- diff --git a/httpx/_models.py b/httpx/_models.py index d6bc46e1..09ad89bc 100644 --- a/httpx/_models.py +++ b/httpx/_models.py @@ -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):