(self, filename)
| 196 | """ |
| 197 | |
| 198 | def __init__(self, filename): |
| 199 | self.buf = None # Set this before FS calls below in case they throw. |
| 200 | self.filename = filename |
| 201 | self.size = os.path.getsize(filename) |
| 202 | self.buf = open(filename, 'rb') |
| 203 | magic = self.buf.read(4) |
| 204 | version = self.buf.read(4) |
| 205 | if magic != MAGIC or version != VERSION: |
| 206 | raise InvalidWasmError(f'{filename} is not a valid wasm file') |
| 207 | self._cache = {} |
| 208 | |
| 209 | def __del__(self): |
| 210 | assert not self.buf, '`__exit__` should have already been called, please use context manager' |
nothing calls this directly
no test coverage detected