commit 10cb40e016ac85a1047f52ebb60d4ba41957e849 Author: haixin Date: Tue Oct 6 16:37:38 2020 +0800 Remove all usage of six library Replace six with Python 3 style code. Change-Id: I559fcf1696c2ce62944b501d54695f8d205db0cf diff --git a/oslobot/plugins/oslobot/oslobot.py b/oslobot/plugins/oslobot/oslobot.py index 360ab36..05c13b7 100644 --- a/oslobot/plugins/oslobot/oslobot.py +++ b/oslobot/plugins/oslobot/oslobot.py @@ -14,8 +14,11 @@ import collections from concurrent import futures import copy from datetime import date +import http.client as http_client +import io import json import re +from urllib.parse import urlencode as compat_urlencode from dateutil import parser from dateutil.relativedelta import relativedelta @@ -25,9 +28,6 @@ from errbot import BotPlugin import feedparser from oslo_utils import timeutils import requests -import six -from six.moves import http_client -from six.moves.urllib.parse import urlencode as compat_urlencode from tabulate import tabulate BAD_VALUE = '??' @@ -383,7 +383,7 @@ class OsloBotPlugin(BotPlugin): str(last_fail_url), str(result.get('discarded', 0)), ]) - buf = six.StringIO() + buf = io.StringIO() buf.write(tabulate(tbl_body, tbl_headers, tablefmt=self.config['tabulate_format'])) return buf.getvalue() diff --git a/oslobot/requirements.txt b/oslobot/requirements.txt index a58eed4..754f523 100644 --- a/oslobot/requirements.txt +++ b/oslobot/requirements.txt @@ -1,6 +1,5 @@ errbot errbot[irc] -six irc python-dateutil requests