diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:04:27 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:04:27 -0500 |
commit | cd4aab1dff5f40aeaa08174a05f15527f67f66d4 (patch) | |
tree | 6ec80f01550ab170cdbc102fdb34b4d623c84c5e | |
parent | 7794b1b0348f2cb76317b40a5ec7931527501c94 (diff) | |
download | python-setuptools-git-cd4aab1dff5f40aeaa08174a05f15527f67f66d4.tar.gz |
Include __enter__ in shim
-rw-r--r-- | setuptools/tests/py26compat.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py index 24e6dbe2..ead72fa6 100644 --- a/setuptools/tests/py26compat.py +++ b/setuptools/tests/py26compat.py @@ -17,10 +17,11 @@ except AttributeError: def _tarfile_open_ex(*args, **kwargs): """ - Extend result with an __exit__ to close the file. + Extend result as a context manager. """ res = tarfile.open(*args, **kwargs) res.__exit__ = lambda self: self.close() + res.__enter__ = lambda self: self return res tarfile_open = _tarfile_open_ex if sys.version_info < (2,7) else tarfile.open |