Skip to content

Commit

Permalink
utils: fix type hint in is_private_ip()
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Dec 11, 2024
1 parent 523b947 commit d78e85c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion slips_files/common/slips_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ def is_port_in_use(self, port: int) -> bool:
sock.close()
return True

def is_private_ip(self, ip: Union[ipaddress, str]) -> bool:
def is_private_ip(
self, ip: Union[ipaddress.IPv4Address, ipaddress.IPv6Address, str]
) -> bool:
ip_classes = {ipaddress.IPv4Address, ipaddress.IPv6Address}
for class_ in ip_classes:
if isinstance(ip, class_):
Expand Down

0 comments on commit d78e85c

Please sign in to comment.