MCPcopy Index your code
hub / github.com/RustPython/RustPython / __enter__

Method __enter__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

resource_infoMethod · 0.95
getFunction · 0.85
appendMethod · 0.45

Tested by

no test coverage detected