Deprecate contextlib.nested(). The with-statement now provides this functionality directly.

This commit is contained in:
Raymond Hettinger 2009-05-29 01:46:48 +00:00
parent b4d2d31874
commit 822b87f276
4 changed files with 11 additions and 2 deletions

View file

@ -2,6 +2,7 @@
import sys
from functools import wraps
from warnings import warn
__all__ = ["contextmanager", "nested", "closing"]
@ -101,6 +102,8 @@ def nested(*managers):
<body>
"""
warn("With-statements now directly support multiple context managers",
DeprecationWarning, 2)
exits = []
vars = []
exc = (None, None, None)