diff options
-rw-r--r-- | setuptools/tests/py26compat.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py index ead72fa6..efe2f956 100644 --- a/setuptools/tests/py26compat.py +++ b/setuptools/tests/py26compat.py @@ -20,8 +20,9 @@ def _tarfile_open_ex(*args, **kwargs): Extend result as a context manager. """ res = tarfile.open(*args, **kwargs) - res.__exit__ = lambda self: self.close() - res.__enter__ = lambda self: self + res.__exit__ = lambda exc_type, exc_value, traceback: self.close() + res.__enter__ = lambda: res return res -tarfile_open = _tarfile_open_ex if sys.version_info < (2,7) else tarfile.open +tarfile_open = _tarfile_open_ex if sys.version_info < (2,7) else tarfile.open +tarfile_open = _tarfile_open_ex |