make sure bool(Response) returns True

This commit is contained in:
Izalia Mae 2024-01-24 19:24:27 -05:00
parent c2aa8c48bb
commit 85a4797e68

View file

@ -180,6 +180,11 @@ class Message(ApMessage):
class Response(AiohttpResponse):
# AiohttpResponse.__len__ method returns 0, so bool(response) always returns False
def __bool__(self) -> bool:
return True
@classmethod
def new(cls: type[Response],
body: str | bytes | dict = '',