Skip to content

fix error comparing IPv6 and IPv4#7

Open
phanhai27 wants to merge 1 commit intovterron:masterfrom
phanhai27:master
Open

fix error comparing IPv6 and IPv4#7
phanhai27 wants to merge 1 commit intovterron:masterfrom
phanhai27:master

Conversation

@phanhai27
Copy link
Copy Markdown

I get the following error: path\site-packages\public_ip\_ip.py", line 74, in get raise ValueError(ValueError: tie between IPv6 and IPv4 among the responses ({first_votes} occurrences each)

I fixed it for IPv4 only like this:

ips = []
while not queue.empty():
        # Fix error comparing IPv6 and IPv4 (if first_votes == second_votes)
        ipx = queue.get()
        if type(ip_address(ipx)) is IPv4Address:
            ips.append(ipx)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant