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

Don't raise a traceback if we cannot de-marshal Python bytecode to support...

Don't raise a traceback if we cannot de-marshal Python bytecode to support Python 3.7 loading newer .pyc files. (Re: #284)
parent 4f7d531d
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
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