diff --git a/ChangeLog b/ChangeLog index d91ae2a..0f32a11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/IPy.py b/IPy.py index 171e8a9..5ee5c30 100644 --- a/IPy.py +++ b/IPy.py @@ -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) diff --git a/README.rst b/README.rst index 44cc556..dcaa427 100644 --- a/README.rst +++ b/README.rst @@ -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 diff --git a/setup.py b/setup.py index 7f6fff5..dfa8931 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ import sys from setuptools import setup -VERSION = '1.01' +VERSION = '1.02' options = {}