use six.StringIO for compatibility with io.StringIO in python3

The newer version of six (1.4.1) provides six.StringIO
which is a fake file object for textual data. It's an
alias for cStringIO.StringIO, in python2 and io.StringIO
in Python3

Change-Id: I5f4af05eb0754d85a73068d5f6b285d4be07cdfc
This commit is contained in:
gengchc2 2016-12-20 11:43:19 +08:00
parent 533d19df4a
commit 40e073a8a1

View File

@ -19,11 +19,12 @@
from __future__ import print_function from __future__ import print_function
import cStringIO as StringIO
import json import json
import re import re
import sys import sys
import six
from pylint import lint from pylint import lint
from pylint.reporters import text from pylint.reporters import text
@ -136,7 +137,7 @@ class ErrorKeys(object):
def run_pylint(): def run_pylint():
buff = StringIO.StringIO() buff = six.StringIO()
reporter = text.ParseableTextReporter(output=buff) reporter = text.ParseableTextReporter(output=buff)
args = ["--include-ids=y", "-E", "manila"] args = ["--include-ids=y", "-E", "manila"]
lint.Run(args, reporter=reporter, exit=False) lint.Run(args, reporter=reporter, exit=False)