Skip to content

Commit be92778

Browse files
authored
Update engine_headless.py
1 parent e616e42 commit be92778

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

examples/engine_headless.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585
serialized_module_file = tempfile.TemporaryFile()
8686
serialized_module_file.write(serialized_module)
8787

88+
# We seek to the initial position, so when we read it starts from the beginning
89+
serialized_module_file.seek(0, 0)
90+
8891

8992
# Second step, deserialize the compiled Wasm module, and execute it,
9093
# for example with Wasmer without a compiler.
@@ -102,7 +105,6 @@
102105
#
103106
# Deserialize the compiled Wasm module. This code is unsafe because
104107
# Wasmer can't assert the bytes are valid, so be careful.
105-
serialized_module_file.seek(0, 0)
106108
module = Module.deserialize(store, serialized_module_file.read())
107109

108110
# Congrats, the Wasm module has been deserialized! Now let's execute

0 commit comments

Comments
 (0)