chiark / gitweb /
Switch to io.StringIO
authorDaniel Martí <mvdan@mvdan.cc>
Mon, 4 Jan 2016 16:00:21 +0000 (17:00 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Thu, 10 Mar 2016 16:43:37 +0000 (16:43 +0000)
fdroidserver/metadata.py
fdroidserver/rewritemeta.py

index 52771fbd6a3f30500338914347fa50553c7b7651..e5750cb7f819310b329e7a958be607d6989977c2 100644 (file)
@@ -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
index 651349cd3fe60cc98663d3e57a6379550fd72540..407cb512c086b6c9e37566f6e719030ca039f5f5 100644 (file)
 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: