MCPcopy Index your code
hub / github.com/python/cpython / __enter__

Method __enter__

Lib/test/test_launcher.py:155–160  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

153 self._preserved = None
154
155 def __enter__(self):
156 try:
157 self._preserved = self.path.read_bytes()
158 except FileNotFoundError:
159 self._preserved = None
160 self.path.write_text(self.content, encoding="utf-16")
161
162 def __exit__(self, *exc_info):
163 if self._preserved is None:

Callers

nothing calls this directly

Calls 2

read_bytesMethod · 0.45
write_textMethod · 0.45

Tested by

no test coverage detected