summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-01-16 17:23:18 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-01-16 17:23:18 -0500
commit7ce4bd5e9345329b1b78c6f517dbe267c8710fc6 (patch)
treef4f821f31fc7c16dae03a01fad3171c2624e0a07
parentb6ae8e7b716f5207f5e67ae06461a7cd837641e3 (diff)
downloadpython-setuptools-bitbucket-7ce4bd5e9345329b1b78c6f517dbe267c8710fc6.tar.gz
Just use BytesIO
-rw-r--r--setuptools/tests/test_easy_install.py8
1 files changed, 1 insertions, 7 deletions
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
@@ -465,14 +465,8 @@ 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())