def check_downgrade(self, current_version, new_version):
        """
        Raise ValueError if new_version is lower then current_version
        """
        curr_tuple = map(int, current_version.split("."))
        new_tuple = map(int, new_version.split("."))


        for i in xrange(0, len(curr_tuple)):
            if len(new_tuple) < (i+1):
                raise ValueError("Attempt to downgrade %s to %s (%s)" % (
                    current_version,
                    new_version,
                    self._pname,
                ))
            elif new_tuple[i] > curr_tuple[i]:
                return True
            elif (new_tuple[i] < curr_tuple[i]):
                raise ValueError("Attempt to downgrade %s to %s (%s)" % (
                    current_version,
                    new_version,
                    self._pname,
                ))
        return True
dataset/ETHPy150Open ella/citools/citools/debian/control.py/ControlFile.check_downgrade/original