From efb37fc9c2e20f79f742e976e1bcd7fa2a27c5f0 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 16 Jan 2016 17:23:18 -0500 Subject: Just use BytesIO --- setuptools/tests/test_easy_install.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'setuptools/tests/test_easy_install.py') diff --git a/setuptools/tests/test_easy_install.py b/setuptools/tests/test_easy_install.py index 4f9e52d1..77cf8da1 100644 --- a/setuptools/tests/test_easy_install.py +++ b/setuptools/tests/test_easy_install.py @@ -464,15 +464,9 @@ def make_sdist(dist_path, files): dist = tarfile.open(dist_path, 'w:gz') - try: - # Python 3 (StringIO gets converted to io module) - MemFile = BytesIO - except AttributeError: - MemFile = StringIO - try: for filename, content in files: - file_bytes = MemFile(content.encode('utf-8')) + file_bytes = io.BytesIO(content.encode('utf-8')) file_info = tarfile.TarInfo(name=filename) file_info.size = len(file_bytes.getvalue()) file_info.mtime = int(time.time()) -- cgit v1.2.1