Commit 42c4c3a2 authored by Chris Lamb's avatar Chris Lamb 👀
Browse files

comparators.utils: Don't uselessly run xxd(1) on non-directories.



Signed-off-by: Chris Lamb's avatarChris Lamb <lamby@debian.org>
parent db37e555
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -200,6 +200,8 @@ class File(object, metaclass=abc.ABCMeta):

    def has_same_content_as(self, other):
        logger.debug('Binary.has_same_content: %s %s', self, other)
        if os.path.isdir(self.path) or os.path.isdir(other.path):
            return False
        # try comparing small files directly first
        try:
            my_size = os.path.getsize(self.path)