Loading diffoscope/comparators/utils/file.py +1 −7 Original line number Diff line number Diff line Loading @@ -496,13 +496,7 @@ class File(metaclass=abc.ABCMeta): if difference is None: return None difference.add_comment( "'%s' not available in path. Falling back to binary comparison." % e.command ) package = e.get_package() if package: difference.add_comment( "Install '%s' to get a better output." % package e.get_comment("Falling back to binary comparison.") ) except OutputParsingError as e: difference = self.compare_bytes(other, source=source) Loading diffoscope/exc.py +12 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,18 @@ class RequiredToolNotFound(Exception): def get_package(self): return get_package_provider(self.command) def get_comment(self, infix=''): xs = [ "'{}' not available in path.".format(self.command), infix, ] x = self.get_package() if x: xs.append("Install '{}' to get a better output.".format(x)) return " ".join(x for x in xs if x) class ContainerExtractionError(Exception): def __init__(self, pathname, wrapped_exc): Loading Loading
diffoscope/comparators/utils/file.py +1 −7 Original line number Diff line number Diff line Loading @@ -496,13 +496,7 @@ class File(metaclass=abc.ABCMeta): if difference is None: return None difference.add_comment( "'%s' not available in path. Falling back to binary comparison." % e.command ) package = e.get_package() if package: difference.add_comment( "Install '%s' to get a better output." % package e.get_comment("Falling back to binary comparison.") ) except OutputParsingError as e: difference = self.compare_bytes(other, source=source) Loading
diffoscope/exc.py +12 −0 Original line number Diff line number Diff line Loading @@ -34,6 +34,18 @@ class RequiredToolNotFound(Exception): def get_package(self): return get_package_provider(self.command) def get_comment(self, infix=''): xs = [ "'{}' not available in path.".format(self.command), infix, ] x = self.get_package() if x: xs.append("Install '{}' to get a better output.".format(x)) return " ".join(x for x in xs if x) class ContainerExtractionError(Exception): def __init__(self, pathname, wrapped_exc): Loading