diff options
author | Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com> | 2015-01-17 21:41:55 +0100 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@GMail.Com> | 2015-01-17 21:41:55 +0100 |
commit | fd7fb7ade0fc879e24543f13c39b00de073004bc (patch) | |
tree | 38437c309d1b921bc329ecb7935e21e187da601c | |
parent | 57fb24d60656bc99192c9768ff04dd78de9ef695 (diff) | |
download | external_python_setuptools-fd7fb7ade0fc879e24543f13c39b00de073004bc.tar.gz external_python_setuptools-fd7fb7ade0fc879e24543f13c39b00de073004bc.tar.bz2 external_python_setuptools-fd7fb7ade0fc879e24543f13c39b00de073004bc.zip |
Fix "AttributeError: 'TarFile' object has no attribute '__exit__'" with Python 3.1.
-rw-r--r-- | setuptools/tests/py26compat.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py index c53b4809..c5680881 100644 --- a/setuptools/tests/py26compat.py +++ b/setuptools/tests/py26compat.py @@ -8,4 +8,7 @@ def _tarfile_open_ex(*args, **kwargs): """ return contextlib.closing(tarfile.open(*args, **kwargs)) -tarfile_open = _tarfile_open_ex if sys.version_info < (2,7) else tarfile.open +if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 2): + tarfile_open = _tarfile_open_ex +else: + tarfile_open = tarfile.open |