Fix StringIO module import to be compatible with Python3

This commit is contained in:
marmeladema 2019-10-14 18:19:07 +01:00
parent 5bd0fca140
commit bf66a08c02
2 changed files with 4 additions and 4 deletions

View file

@ -16,7 +16,7 @@ import platform
import shutil import shutil
from socket import error as socket_error from socket import error as socket_error
import stat import stat
import StringIO from io import BytesIO
import sys import sys
import time import time
import zipfile import zipfile
@ -154,7 +154,7 @@ def download(desc, src, writer, start_byte=0):
def download_bytes(desc, src): def download_bytes(desc, src):
content_writer = StringIO.StringIO() content_writer = BytesIO()
download(desc, src, content_writer) download(desc, src, content_writer)
return content_writer.getvalue() return content_writer.getvalue()

View file

@ -16,7 +16,7 @@ import itertools
import json import json
import os import os
import re import re
import StringIO from io import StringIO
import subprocess import subprocess
import sys import sys
@ -345,7 +345,7 @@ def check_flake8(file_name, contents):
"E501", # 80 character line length; the standard tidy process will enforce line length "E501", # 80 character line length; the standard tidy process will enforce line length
} }
output = StringIO.StringIO() output = StringIO()
with stdout_redirect(output): with stdout_redirect(output):
check_code(contents, ignore=ignore) check_code(contents, ignore=ignore)
for error in output.getvalue().splitlines(): for error in output.getvalue().splitlines():