8000 bpo-27683: Fix a regression for ipaddress networks that hosts() result by zhangyangyu · Pull Request #6016 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-27683: Fix a regression for ipaddress networks that hosts() result #6016

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
empty lines
  • Loading branch information
zhangyangyu committed Mar 7, 2018
commit ffd50e064a99e950b6152210bf4fa72822c42ec5
2 changes: 1 addition & 1 deletion Lib/ipaddress.py
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,6 @@ def __init__(self, address, strict=True):
elif isinstance(address, tuple):
addr = address[0]
mask = address[1] if len(address) > 1 else self._max_prefixlen

# Assume input argument to be string or any object representation
# which converts into a formatted IP prefix string.
else:
Expand All @@ -1537,6 +1536,7 @@ def __init__(self, address, strict=True):
else:
self.network_address = IPv4Address(packed &
int(self.netmask))

if self._prefixlen == (self._max_prefixlen - 1):
self.hosts = self.__iter__

Expand Down
0