From b6401b0f2f1c6d62ccc8689cc6718423648925fd Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 24 Mar 2020 18:50:19 -0500 Subject: [PATCH] Update StringIO to use six It's StringIO.StringIO in python2 and io.StringIO in python3, but six.StringIO everywhere. Change-Id: Ief0b091b716e3ea6224c0ac374a6066f0270bebc --- jeepyb/cmd/openstackwatch.py | 4 ++-- jeepyb/cmd/update_blueprint.py | 4 ++-- jeepyb/gerritdb.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/jeepyb/cmd/openstackwatch.py b/jeepyb/cmd/openstackwatch.py index 1064fc7..c9d6a54 100644 --- a/jeepyb/cmd/openstackwatch.py +++ b/jeepyb/cmd/openstackwatch.py @@ -23,8 +23,8 @@ from __future__ import print_function __author__ = "Chmouel Boudjnah " +import six from six.moves import configparser -import cStringIO import datetime import json import os @@ -127,7 +127,7 @@ def upload_to_swift(content, objectname): time.sleep(1) client.put_object(cfg['container'], objectname, - cStringIO.StringIO(content)) + six.StringIO(content)) def generate_rss(content, project=""): diff --git a/jeepyb/cmd/update_blueprint.py b/jeepyb/cmd/update_blueprint.py index 0649dff..c1fd98a 100644 --- a/jeepyb/cmd/update_blueprint.py +++ b/jeepyb/cmd/update_blueprint.py @@ -18,10 +18,10 @@ # corresponding Launchpad blueprints with links back to the change. import argparse +import six from six.moves import configparser import os import re -import StringIO import subprocess from launchpadlib import launchpad @@ -54,7 +54,7 @@ def get_broken_config(filename): for line in conf.readlines(): text = "%s%s" % (text, line.lstrip()) - fp = StringIO.StringIO(text) + fp = six.StringIO(text) c = configparser.ConfigParser() c.readfp(fp) return c diff --git a/jeepyb/gerritdb.py b/jeepyb/gerritdb.py index 963f997..b362240 100644 --- a/jeepyb/gerritdb.py +++ b/jeepyb/gerritdb.py @@ -14,9 +14,9 @@ # License for the specific language governing permissions and limitations # under the License. +import six from six.moves import configparser import os -import StringIO GERRIT_CONFIG = os.environ.get( @@ -34,7 +34,7 @@ def get_broken_config(filename): for line in open(filename, "r"): text += line.lstrip() - fp = StringIO.StringIO(text) + fp = six.StringIO(text) c = configparser.ConfigParser() c.readfp(fp) return c