Skip to content

Commit 8a6e4bf

Browse files
authored
fix: check if response attribute of WebPushException object is not None in __str__ method (#169)
this properly checks if extra info about Response object should be added to string representation of WebPushException as the Response object is falsy in case of the status code being between 400 and 600
1 parent bd71466 commit 8a6e4bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pywebpush/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def __init__(self, message, response=None):
4141

4242
def __str__(self):
4343
extra = ""
44-
if self.response:
44+
if self.response is not None:
4545
try:
4646
extra = ", Response {}".format(
4747
self.response.text,

0 commit comments

Comments
 (0)