From 40e073a8a17a0656e17cf224c5eb81f2402251bd Mon Sep 17 00:00:00 2001 From: gengchc2 Date: Tue, 20 Dec 2016 11:43:19 +0800 Subject: [PATCH] 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 --- tools/lintstack.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/lintstack.py b/tools/lintstack.py index 9dee28565b..da0a6b9750 100755 --- a/tools/lintstack.py +++ b/tools/lintstack.py @@ -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)