From 932c91db97fe8a93ce54f4f4e04e2fd1e28b2275 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 3 Sep 2017 13:24:47 -0400 Subject: Drop support for Python 2.6 --- tests/test_ptr.py | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) (limited to 'tests') 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) -- cgit v1.2.1