Skip to content

Commit 140a60d

Browse files
committed
Fix: chained comparison
1 parent bfe6ec1 commit 140a60d

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

aikido_zen/helpers/ip_matcher/network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def set_cidr(self, cidr):
5151
self.destroy()
5252
else:
5353
cidr = math.floor(cidr)
54-
if cidr >= 0 and cidr <= len(self.addr.bytes()) * 8:
54+
if 0 <= cidr <= len(self.addr.bytes()) * 8:
5555
self.netbits = cidr
5656
else:
5757
self.destroy()

aikido_zen/helpers/is_useful_route.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def is_useful_route(status_code, route, method):
1919
"""
2020
status_code = int(status_code)
2121

22-
is_valid_code = status_code >= 200 and status_code < 400
22+
is_valid_code = 200 <= status_code < 400
2323
if not is_valid_code:
2424
# Status code needs to be between 200 and 400 in order for it to be "useful"
2525
return False

0 commit comments

Comments
 (0)