From 28cfb0840dba648488094ff49a97acc143da9dc4 Mon Sep 17 00:00:00 2001 From: Kevin Lloyd Bernal Date: Wed, 17 Jan 2024 17:04:13 +0800 Subject: [PATCH] simplified returning stats --- web_poet/page_inputs/response.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web_poet/page_inputs/response.py b/web_poet/page_inputs/response.py index e0e88ea0..2b7d6a4c 100644 --- a/web_poet/page_inputs/response.py +++ b/web_poet/page_inputs/response.py @@ -29,9 +29,7 @@ def text(self) -> str: @property def status(self) -> Optional[int]: """The int status code of the HTTP response, if available.""" - if getattr(self.response, "status", None): - return self.response.status - return None + return self.response.status def _selector_input(self) -> str: return self.text