[captcha] Port to io.BytesIO
authorRémi Cardona <remi.cardona@free.fr>
Tue, 19 Aug 2014 00:16:02 +0200
changeset 10566 4c103a2c5e93
parent 10565 f5063eae939e
child 10567 c316e0049b9c
[captcha] Port to io.BytesIO
web/captcha.py
--- a/web/captcha.py	Thu Feb 13 17:00:40 2014 +0100
+++ b/web/captcha.py	Tue Aug 19 00:16:02 2014 +0200
@@ -22,7 +22,7 @@
 __docformat__ = "restructuredtext en"
 
 from random import randint, choice
-from cStringIO import StringIO
+from io import BytesIO
 
 from PIL import Image, ImageFont, ImageDraw, ImageFilter
 
@@ -67,7 +67,7 @@
     """
     text = u''.join(choice('QWERTYUOPASDFGHJKLZXCVBNM') for i in range(size))
     img = pil_captcha(text, fontfile, fontsize)
-    out = StringIO()
+    out = BytesIO()
     img.save(out, format)
     out.seek(0)
     return text, out