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

Method __enter__

Lib/test/libregrtest/save_env.py:328–337  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

326 yield name, getattr(self, get_name), getattr(self, restore_name)
327
328 def __enter__(self):
329 self.saved_values = []
330 for name, get, restore in self.resource_info():
331 try:
332 original = get()
333 except SkipTestEnvironment:
334 continue
335
336 self.saved_values.append((name, get, restore, original))
337 return self
338
339 def __exit__(self, exc_type, exc_val, exc_tb):
340 saved_values = self.saved_values

Callers

nothing calls this directly

Calls 3

resource_infoMethod · 0.95
getFunction · 0.50
appendMethod · 0.45

Tested by

no test coverage detected