Fix nested() for py3
nested() should return enter_context instead of nothing. Change-Id: I910eace453d07e2f9a12dd0ce0eca22f4d155472
This commit is contained in:
parent
b80fceaf40
commit
86c136a084
@ -25,9 +25,7 @@ if six.PY3:
|
||||
@contextlib.contextmanager
|
||||
def nested(*contexts):
|
||||
with contextlib.ExitStack() as stack:
|
||||
for c in contexts:
|
||||
stack.enter_context(c)
|
||||
yield
|
||||
yield [stack.enter_context(c) for c in contexts]
|
||||
else:
|
||||
nested = contextlib.nested
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user