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

compators.wasm: Use File.file_header to simplify file detection.

parent f0ae5eba
No related branches found
No related tags found
No related merge requests found
......@@ -42,9 +42,8 @@ class WasmFile(File):
def recognizes(cls, file):
if not super().recognizes(file):
return False
with open(file.path, 'rb') as f:
magic = f.read(4)
return magic == WASM_MAGIC
return file.file_header.startswith(WASM_MAGIC)
def compare_details(self, other, source=None):
return [Difference.from_command(Wasm2Wat, self.path, other.path)]
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