Skip to content
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

Release 1.02 Fix a bug: last_ip can't be compressed #74

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 4 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 1.02 (2021-01-20)
------------
* Fix a bug: `last_ip` can't be compressed

Version 1.01 (2020-12-01)
------------
* Update to support up to Python 3.9
Expand Down
7 changes: 6 additions & 1 deletion IPy.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,12 @@ def strCompressed(self, wantprefixlen = None):
hextets.append('')
if compressionpos == 0:
hextets = [''] + hextets
return ':'.join(hextets) + self._printPrefix(wantprefixlen)
# fix the bug: `last_ip` can't be compressed
if wantprefixlen == 3:
_last = "-%s" % (IPint(self.ip + self.len() - 1).strCompressed())
else:
_last = self._printPrefix(wantprefixlen)
return ':'.join(hextets) + _last
else:
return self.strNormal(0) + self._printPrefix(wantprefixlen)

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ unique address ranges and will aggregate overlapping ranges. ::
Compatibility and links
=======================

IPy 1.01 works on Python version 2.6 - 3.7.
IPy 1.02 works on Python version 2.6 - 3.7.

The IP module should work in Python 2.5 as long as the subtraction operation
is not used. IPSet requires features of the collections class which appear
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import sys
from setuptools import setup

VERSION = '1.01'
VERSION = '1.02'

options = {}

Expand Down