Skip to content

Commit 90ce536

Browse files
committed
Minor refactor of sending response, modified guard
1 parent 87b0e27 commit 90ce536

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adafruit_httpserver/server.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -326,12 +326,14 @@ def poll(self):
326326
# Handle the request
327327
response = self._handle_request(request, handler)
328328

329+
if response is None:
330+
return
331+
329332
# Send the response
330-
if response is not None:
331-
response._send() # pylint: disable=protected-access
333+
response._send() # pylint: disable=protected-access
332334

333-
if self.debug:
334-
_debug_response_sent(response)
335+
if self.debug:
336+
_debug_response_sent(response)
335337

336338
except Exception as error: # pylint: disable=broad-except
337339
if isinstance(error, OSError):

0 commit comments

Comments
 (0)