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

Don't fail if comparing a nonexistent file with a .pyc file (and add test)....

Don't fail if comparing a nonexistent file with a .pyc file (and add test). (Closes: Debian:#1004312)
parent a3abe03d
No related branches found
No related tags found
No related merge requests found
Pipeline #340895 passed
# #
# diffoscope: in-depth comparison of files, archives, and directories # diffoscope: in-depth comparison of files, archives, and directories
# #
# Copyright © 2021 Chris Lamb <lamby@debian.org> # Copyright © 2021‒2022 Chris Lamb <lamby@debian.org>
# Copyright © 2021 Sergei Trofimovich # Copyright © 2021 Sergei Trofimovich
# #
# diffoscope is free software: you can redistribute it and/or modify # diffoscope is free software: you can redistribute it and/or modify
...@@ -28,6 +28,7 @@ import types ...@@ -28,6 +28,7 @@ import types
from diffoscope.difference import Difference from diffoscope.difference import Difference
from .missing_file import MissingFile
from .utils.file import File from .utils.file import File
re_memory_address = re.compile(r" at 0x\w+(?=, )") re_memory_address = re.compile(r" at 0x\w+(?=, )")
...@@ -38,6 +39,9 @@ class PycFile(File): ...@@ -38,6 +39,9 @@ class PycFile(File):
FILE_TYPE_RE = re.compile(r"^python .*byte-compiled$") FILE_TYPE_RE = re.compile(r"^python .*byte-compiled$")
def compare_details(self, other, source=None): def compare_details(self, other, source=None):
if isinstance(other, MissingFile):
return []
try: try:
return [ return [
Difference.from_text( Difference.from_text(
......
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