[issue6256] Wrong stacklevel in warning for contextlib.nested

Hagen Fürstenau report at bugs.python.org
Wed Jun 10 18:08:12 CEST 2009


New submission from Hagen Fürstenau <hfuerstenau at gmx.net>:

This leads to unhelpful warnings:

>>> with contextlib.nested(open("x", "w")) as f: pass
... 
/usr/local/lib/python3.1/contextlib.py:17: DeprecationWarning:
With-statements now directly support multiple context managers
  return next(self.gen)

Patch is attached.

----------
components: Library (Lib)
files: warning_stacklevel.patch
keywords: patch
messages: 89209
nosy: hagen
severity: normal
status: open
title: Wrong stacklevel in warning for contextlib.nested
type: behavior
versions: Python 2.7, Python 3.1
Added file: http://bugs.python.org/file14259/warning_stacklevel.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6256>
_______________________________________


More information about the Python-bugs-list mailing list