aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/tests/py26compat.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2014-12-30 10:12:57 -0500
committerJason R. Coombs <jaraco@jaraco.com>2014-12-30 10:12:57 -0500
commit271734598e6c9fc50b4809ee223cc3281d54615c (patch)
tree0affa551f71e0192bc35d2d882360449ced7c0a1 /setuptools/tests/py26compat.py
parentcd4aab1dff5f40aeaa08174a05f15527f67f66d4 (diff)
downloadexternal_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.py7
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