Skip to content
Snippets Groups Projects
Commit 78aae03c authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Don't traceback when comparing nested directories with non-directories....

Don't traceback when comparing nested directories with non-directories. (Closes: #288)
parent e1352fcd
No related branches found
Tags 215
No related merge requests found
Pipeline #316124 passed
......@@ -253,6 +253,9 @@ class FilesystemDirectory(Directory):
def compare(self, other, source=None):
differences = []
if not isinstance(other, FilesystemDirectory):
return differences
# We don't need to recurse into subdirectories; DirectoryContainer will
# find them and do that for us.
def list_files(path):
......
......@@ -118,8 +118,10 @@ def compare_files(file1, file2, source=None, diff_content_only=False):
file1.other_file = file2
elif isinstance(file2, MissingFile):
file2.other_file = file1
elif (file1.__class__.__name__ != file2.__class__.__name__) and (
file1.as_container is None or file2.as_container is None
elif (
(file1.__class__.__name__ != file2.__class__.__name__)
and (file1.as_container is None or file2.as_container is None)
and (not file1.is_directory() and not file2.is_directory())
):
return file1.compare_bytes(file2, source)
with profile("compare_files (cumulative)", file1):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment