Commits (2)
......@@ -38,15 +38,19 @@ class PycFile(File):
FILE_TYPE_RE = re.compile(r"^python .*byte-compiled$")
def compare_details(self, other, source=None):
return [
Difference.from_text(
describe_pyc(self.path),
describe_pyc(other.path),
self.path,
other.path,
source="Python bytecode",
)
]
try:
return [
Difference.from_text(
describe_pyc(self.path),
describe_pyc(other.path),
self.path,
other.path,
source="Python bytecode",
)
]
except ValueError as exc:
self.add_comment("Could not decombile bytecode: {}".format(exc))
return []
def describe_pyc(filename):
......
......@@ -51,6 +51,10 @@ def differences(pyc1, pyc2):
@skip_unless_file_version_is_at_least("5.39")
@skipif(
sys.version_info < (3, 8),
reason="Python 3.7 cannot de-marshal test1.pyc-renamed",
)
def test_diff(differences):
assert_diff_startswith(
differences[0],
......