Skip to content

Commit 98fa438

Browse files
committed
Bugfix: Handle sets.
This patch fixes #358. Indeed, before this patch, we always assumed the the given status codes will either be given as list or tuple. As of #359, sets were introduced which may produce some unstability. Therefore, this patch fixes the issue by ensuring that set are acceptable inputs when trying to switch status based on the status code of the tested subject. Contributors: * @spirillen
1 parent 12a6b61 commit 98fa438

File tree

1 file changed

+1
-1
lines changed
  • PyFunceble/checker/availability/extras

1 file changed

+1
-1
lines changed

PyFunceble/checker/availability/extras/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def switch_to_down_if_status_code(
422422
of the given one.
423423
"""
424424

425-
if not isinstance(status_code, (list, tuple)):
425+
if not isinstance(status_code, (list, tuple, set)):
426426
status_code = [status_code]
427427

428428
if any(self.status.http_status_code == x for x in status_code):

0 commit comments

Comments
 (0)