diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:12:57 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2014-12-30 10:12:57 -0500 |
commit | 271734598e6c9fc50b4809ee223cc3281d54615c (patch) | |
tree | 0affa551f71e0192bc35d2d882360449ced7c0a1 /setuptools/tests/py26compat.py | |
parent | cd4aab1dff5f40aeaa08174a05f15527f67f66d4 (diff) | |
download | external_python_setuptools-271734598e6c9fc50b4809ee223cc3281d54615c.tar.gz external_python_setuptools-271734598e6c9fc50b4809ee223cc3281d54615c.tar.bz2 external_python_setuptools-271734598e6c9fc50b4809ee223cc3281d54615c.zip |
Try without self, as methods are set on the instance. Also include parameters to __exit__.
Diffstat (limited to 'setuptools/tests/py26compat.py')
-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 |