mirror of
https://github.com/jazzband/contextlib2.git
synced 2026-05-28 16:28:17 +00:00
2.6 compatibility
This commit is contained in:
parent
30515dbe4f
commit
f1d447328a
1 changed files with 1 additions and 1 deletions
|
|
@ -184,7 +184,7 @@ class redirect_stdout:
|
||||||
|
|
||||||
def __enter__(self):
|
def __enter__(self):
|
||||||
if self._old_target is not self._sentinel:
|
if self._old_target is not self._sentinel:
|
||||||
raise RuntimeError("Cannot reenter {!r}".format(self))
|
raise RuntimeError("Cannot reenter {0!r}".format(self))
|
||||||
self._old_target = sys.stdout
|
self._old_target = sys.stdout
|
||||||
sys.stdout = self._new_target
|
sys.stdout = self._new_target
|
||||||
return self._new_target
|
return self._new_target
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue