comparison venv/lib/python2.7/site-packages/setuptools/tests/py26compat.py @ 0:d67268158946 draft

planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
author bcclaywell
date Mon, 12 Oct 2015 17:43:33 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d67268158946
1 import sys
2 import tarfile
3 import contextlib
4
5 def _tarfile_open_ex(*args, **kwargs):
6 """
7 Extend result as a context manager.
8 """
9 return contextlib.closing(tarfile.open(*args, **kwargs))
10
11 if sys.version_info[:2] < (2, 7) or (3, 0) <= sys.version_info[:2] < (3, 2):
12 tarfile_open = _tarfile_open_ex
13 else:
14 tarfile_open = tarfile.open