Use six.StringIO/BytesIO instead of StringIO.StringIO
to keep Python 3.x compatibility, use six.StringIO/BytesIO to
replace StringIO.StringIO
StringIO works for unicode
BytesIO works for bytes
Change-Id: I063d62a4f005084f4088da403f348ad97656ad45
Partial-Bug: #1280100
diff --git a/tools/check_logs.py b/tools/check_logs.py
index c8d3a1a..9b707b0 100755
--- a/tools/check_logs.py
+++ b/tools/check_logs.py
@@ -19,7 +19,7 @@
import gzip
import os
import re
-import StringIO
+import six
import sys
import urllib2
@@ -71,7 +71,7 @@
req = urllib2.Request(url)
req.add_header('Accept-Encoding', 'gzip')
page = urllib2.urlopen(req)
- buf = StringIO.StringIO(page.read())
+ buf = six.StringIO(page.read())
f = gzip.GzipFile(fileobj=buf)
if scan_content(name, f.read().splitlines(), regexp, whitelist):
logs_with_errors.append(name)