Commit 91cdaf4b authored by Michal Čihař's avatar Michal Čihař

Use BytesIO for raw data processing

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 92748cd8
...@@ -23,6 +23,7 @@ File format specific behavior. ...@@ -23,6 +23,7 @@ File format specific behavior.
from __future__ import unicode_literals from __future__ import unicode_literals
from io import BytesIO
import subprocess import subprocess
import os.path import os.path
import re import re
...@@ -33,7 +34,6 @@ import importlib ...@@ -33,7 +34,6 @@ import importlib
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
import six import six
from six import StringIO
from translate.convert import po2php from translate.convert import po2php
from translate.storage.lisa import LISAfile from translate.storage.lisa import LISAfile
...@@ -62,13 +62,12 @@ class ParseError(Exception): ...@@ -62,13 +62,12 @@ class ParseError(Exception):
"""Generic error for parsing.""" """Generic error for parsing."""
class StringIOMode(StringIO): class StringIOMode(BytesIO):
""" """
StringIO with mode attribute to make ttkit happy. StringIO with mode attribute to make ttkit happy.
""" """
def __init__(self, filename, data): def __init__(self, filename, data):
# pylint: disable=W0233 super(StringIOMode, self).__init__(self, data)
StringIO.__init__(self, data)
self.mode = 'r' self.mode = 'r'
self.name = filename self.name = filename
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment