diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2016-01-16 17:23:18 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2016-01-16 17:23:18 -0500 |
| commit | efb37fc9c2e20f79f742e976e1bcd7fa2a27c5f0 (patch) | |
| tree | ee75b68b316ce72db7ed3b7bc10081751a5f0394 /setuptools/tests | |
| parent | 38f276fb8b9ef77c7f34d11460f0ba072def3467 (diff) | |
| download | python-setuptools-git-efb37fc9c2e20f79f742e976e1bcd7fa2a27c5f0.tar.gz | |
Just use BytesIO
Diffstat (limited to 'setuptools/tests')
| -rw-r--r-- | setuptools/tests/test_easy_install.py | 8 |
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()) |
