python3: remove more cStringIO

This commit is contained in:
Eli Schwartz 2019-03-26 14:26:32 -04:00
parent 4919373608
commit 24f504f16b
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
2 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@ Device drivers.
import sys, time, pprint
from functools import partial
from StringIO import StringIO
from io import BytesIO
DAY_MAP = dict(Sun=0, Mon=1, Tue=2, Wed=3, Thu=4, Fri=5, Sat=6)
MONTH_MAP = dict(Jan=1, Feb=2, Mar=3, Apr=4, May=5, Jun=6, Jul=7, Aug=8, Sep=9, Oct=10, Nov=11, Dec=12)
@ -77,7 +77,7 @@ def debug(ioreg_to_tmp=False, buf=None, plugins=None,
oldo, olde = sys.stdout, sys.stderr
if buf is None:
buf = StringIO()
buf = BytesIO()
sys.stdout = sys.stderr = buf
out = partial(prints, file=buf)

View File

@ -4,7 +4,7 @@ __license__ = 'GPL 3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from cStringIO import StringIO
from io import BytesIO
from calibre.customize.conversion import InputFormatPlugin
@ -24,7 +24,7 @@ class TCRInput(InputFormatPlugin):
raw_txt = decompress(stream)
log.info('Converting text to OEB...')
stream = StringIO(raw_txt)
stream = BytesIO(raw_txt)
from calibre.customize.ui import plugin_for_input_format