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

This commit is contained in:
Raymond Hettinger 2009-05-28 22:20:03 +00:00
parent fb12391c44
commit 91e3b9d89d
5 changed files with 10 additions and 123 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)