diff --git a/fdroidserver/metadata.py b/fdroidserver/metadata.py index 52771fbd..e5750cb7 100644 --- a/fdroidserver/metadata.py +++ b/fdroidserver/metadata.py @@ -23,11 +23,7 @@ import re import glob import cgi import textwrap - -try: - from cStringIO import StringIO -except: - from StringIO import StringIO +import io import yaml # use libyaml if it is available @@ -513,8 +509,8 @@ class DescriptionFormatter: self.laststate = self.stNONE self.text_html = '' self.text_txt = '' - self.html = StringIO() - self.text = StringIO() + self.html = io.StringIO() + self.text = io.StringIO() self.para_lines = [] self.linkResolver = None self.linkResolver = linkres diff --git a/fdroidserver/rewritemeta.py b/fdroidserver/rewritemeta.py index 651349cd..407cb512 100644 --- a/fdroidserver/rewritemeta.py +++ b/fdroidserver/rewritemeta.py @@ -20,10 +20,7 @@ from argparse import ArgumentParser import os import logging -try: - from cStringIO import StringIO -except: - from StringIO import StringIO +import io import common import metadata @@ -33,7 +30,7 @@ options = None def proper_format(app): - s = StringIO() + s = io.StringIO() # TODO: currently reading entire file again, should reuse first # read in metadata.py with open(app.metadatapath, 'r') as f: