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

Method __exit__

Lib/test/test_with.py:85–98  ·  view source on GitHub ↗
(self, *exc_info)

Source from the content-addressed store, hash-verified

83 return vars
84
85 def __exit__(self, *exc_info):
86 # Behave like nested with statements
87 # first in, last out
88 # New exceptions override old ones
89 ex = exc_info
90 for mgr in self.entered:
91 try:
92 if mgr.__exit__(*ex):
93 ex = (None, None, None)
94 except BaseException as e:
95 ex = (type(e), e, e.__traceback__)
96 self.entered = None
97 if ex is not exc_info:
98 raise ex
99
100
101class MockNested(Nested):

Callers 6

__enter__Method · 0.95
__exit__Method · 0.45
__exit__Method · 0.45
tearDownMethod · 0.45
tearDownMethod · 0.45
testMethodsMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected