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
1 changed files with 3 additions and 2 deletions

View File

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