MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / __enter__

Method __enter__

tools/tempfiles.py:40–43  ·  view source on GitHub ↗
(self_)

Source from the content-addressed store, hash-verified

38 """
39 class TempFileObject:
40 def __enter__(self_): # noqa: DC02
41 self_.file = tempfile.NamedTemporaryFile(dir=self.tmpdir, suffix=suffix, delete=False)
42 self_.file.close() # NamedTemporaryFile passes out open file handles, but callers prefer filenames (and open their own handles manually if needed)
43 return self_.file.name
44
45 def __exit__(self_, _type, _value, _traceback): # noqa: DC02
46 if not self.save_debug_files:

Callers

nothing calls this directly

Calls 1

closeMethod · 0.45

Tested by

no test coverage detected