diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2017-09-03 13:24:47 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2017-09-03 13:24:47 -0400 |
commit | 932c91db97fe8a93ce54f4f4e04e2fd1e28b2275 (patch) | |
tree | 623fe131b6fd91e2c9027642069db2ac4ae4f252 /tests/test_ptr.py | |
parent | 18c23373216a57bd0301a07601120aecd95906f4 (diff) | |
download | pytest-runner-feature/drop-py26.tar.gz |
Drop support for Python 2.6feature/drop-py26
Diffstat (limited to 'tests/test_ptr.py')
-rw-r--r-- | tests/test_ptr.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/tests/test_ptr.py b/tests/test_ptr.py index aeb0f8d..aac5e75 100644 --- a/tests/test_ptr.py +++ b/tests/test_ptr.py @@ -1,6 +1,5 @@ from __future__ import unicode_literals -import contextlib import io import os import sys @@ -16,26 +15,13 @@ def DALS(s): return textwrap.dedent(s).lstrip() -def _tarfile_open_ex(*args, **kwargs): - """ - Extend result as a context manager. - """ - return contextlib.closing(tarfile.open(*args, **kwargs)) - - -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 - - def make_sdist(dist_path, files): """ Create a simple sdist tarball at dist_path, containing the files listed in ``files`` as ``(filename, content)`` tuples. """ - with tarfile_open(dist_path, 'w:gz') as dist: + with tarfile.open(dist_path, 'w:gz') as dist: for filename, content in files: file_bytes = io.BytesIO(content.encode('utf-8')) file_info = tarfile.TarInfo(name=filename) |