From 934110a7d7948a8b4e423df2469247491b861d44 Mon Sep 17 00:00:00 2001 From: piernov Date: Sat, 28 Feb 2015 22:21:44 +0100 Subject: Fix StringIO includes --- jm2l/captcha.py | 4 ++-- jm2l/upload.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/jm2l/captcha.py b/jm2l/captcha.py index 4fd6828..8ec778f 100644 --- a/jm2l/captcha.py +++ b/jm2l/captcha.py @@ -3,7 +3,7 @@ import random from PIL import Image, ImageDraw, ImageFont, ImageFilter -import StringIO +from io import BytesIO import math from pyramid.view import view_config from .words import TabMots @@ -145,7 +145,7 @@ def DoCaptcha(request): # Save Result request.session['Captcha'] = text #session.save() - ImgHandle = StringIO.StringIO() + ImgHandle = BytesIO() WorkImg.save(ImgHandle,'png') ImgHandle.seek(0) return Response(app_iter=ImgHandle, content_type = 'image/png') diff --git a/jm2l/upload.py b/jm2l/upload.py index cbbbfff..22281b8 100644 --- a/jm2l/upload.py +++ b/jm2l/upload.py @@ -9,7 +9,7 @@ from os import path import mimetypes import magic import subprocess -import cStringIO as StringIO +from io import StringIO # Database access imports from .models import User, Place, Tiers, Event -- cgit v1.2.3-70-g09d2