Commit 6437c484 authored by Michal Čihař's avatar Michal Čihař

Use BytesIO for binary output

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 7793da09
...@@ -19,13 +19,13 @@ ...@@ -19,13 +19,13 @@
# #
import os.path import os.path
from io import BytesIO
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from django.template.loader import render_to_string from django.template.loader import render_to_string
from PIL import Image, ImageDraw from PIL import Image, ImageDraw
from six import StringIO
from six.moves.urllib.parse import quote from six.moves.urllib.parse import quote
from weblate.trans.fonts import is_base, get_font from weblate.trans.fonts import is_base, get_font
...@@ -242,7 +242,7 @@ class Widget(object): ...@@ -242,7 +242,7 @@ class Widget(object):
''' '''
Returns PNG data. Returns PNG data.
''' '''
out = StringIO() out = BytesIO()
if self.alpha: if self.alpha:
image = self.image image = self.image
else: else:
......
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