]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Use six.moves cStringIO instead of cStringIO
authorHe Yongli <yongli.he@intel.com>
Mon, 17 Feb 2014 06:41:25 +0000 (14:41 +0800)
committerHe Yongli <yongli.he@intel.com>
Mon, 17 Feb 2014 07:13:49 +0000 (15:13 +0800)
to keep Python 3.x compatibility, use six.moves.cStringIO to
replace StringIO

Change-Id: Id89c6156d9bba0007e8b16cd2cc28413a7cc5fd3
Closes-Bug: #1280964

tools/lintstack.py

index afd22558b93afd842ca13f3e68e80443a9cf408a..b4d252c9dcc07e962edbfec72213460cff629dfc 100755 (executable)
 
 from __future__ import print_function
 
-import cStringIO as StringIO
 import json
 import re
 import sys
 
 from pylint import lint
 from pylint.reporters import text
+from six.moves import cStringIO as StringIO
 
 # Note(maoy): E1103 is error code related to partial type inference
 ignore_codes = ["E1103"]
@@ -127,7 +127,7 @@ class ErrorKeys(object):
 
 
 def run_pylint():
-    buff = StringIO.StringIO()
+    buff = StringIO()
     reporter = text.ParseableTextReporter(output=buff)
     args = ["--include-ids=y", "-E", "cinder"]
     lint.Run(args, reporter=reporter, exit=False)