Browse Source

Remove six

The repo does not support python2 anymore, remove usage of python2/3
compatability library.

Change-Id: Ifa95482b219bcf143762e9328c4200f1ffc772be
changes/91/702091/2
Andreas Jaeger 2 years ago
parent
commit
098dbcbae4
  1. 5
      gerrit_dash_creator/cmd/bugs.py
  2. 8
      gerrit_dash_creator/cmd/creator.py
  3. 1
      requirements.txt

5
gerrit_dash_creator/cmd/bugs.py

@ -13,12 +13,11 @@
# under the License.
import argparse
import configparser
import os
import sys
from launchpadlib import launchpad
import six
from six.moves import configparser
from gerrit_dash_creator.cmd import creator
@ -71,7 +70,7 @@ def review_id_from_bug(bug, project_name):
reviews_ignored = set()
for msg in bug.bug.messages:
try:
lines = six.text_type(msg.content).split('\n')
lines = str(msg.content).split('\n')
except UnicodeEncodeError:
print('non-ascii in bug %s' % bug.web_link)
continue

8
gerrit_dash_creator/cmd/creator.py

@ -13,14 +13,14 @@
# under the License.
import argparse
import configparser
import io
import os
import os.path
import sys
from urllib import parse as urllib_parse
import jinja2
import six
from six.moves import configparser
from six.moves.urllib import parse as urllib_parse
def escape(buff):
@ -128,7 +128,7 @@ def load_template(template_file=None, template_directory=None,
def get_configuration(dashboard):
"""Returns the configuration of a dashboard as string."""
configuration = six.StringIO()
configuration = io.StringIO()
dashboard.write(configuration)
result = configuration.getvalue()
configuration.close()

1
requirements.txt

@ -4,5 +4,4 @@
jinja2
pbr>=1.6
six>=1.9.0
simplejson>=2.2.0
Loading…
Cancel
Save