summaryrefslogtreecommitdiff
path: root/Lib/contextlib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-05-28 22:20:03 +0000
committerRaymond Hettinger <python@rcn.com>2009-05-28 22:20:03 +0000
commit94c9154429ff9f502e164774572e972208b0152d (patch)
tree080ccd101b8f84a49d0424a56b13cd6eb6cf656c /Lib/contextlib.py
parent577b1993f93ecc14b494ddee6c66ff39da901b04 (diff)
downloadcpython-94c9154429ff9f502e164774572e972208b0152d.tar.gz
Deprecate contextlib.nested(). The with-statement now provides this functionality directly.
Diffstat (limited to 'Lib/contextlib.py')
-rw-r--r--Lib/contextlib.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/contextlib.py b/Lib/contextlib.py
index 647efdd26d..0841ac33ed 100644
--- a/Lib/contextlib.py
+++ b/Lib/contextlib.py
@@ -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)