web/captcha.py
changeset 10566 4c103a2c5e93
parent 9772 7d0d622c9bc9
child 10609 e2d8e81bfe68
--- 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