From cfa87cb54345ef89a15c1c74893713f2582084dc Mon Sep 17 00:00:00 2001 From: Hsiaoming Yang Date: Tue, 2 Dec 2014 20:25:29 +0800 Subject: [PATCH] Fix randint for Python 3 --- captcha/image.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/captcha/image.py b/captcha/image.py index 1820883..61af3a8 100644 --- a/captcha/image.py +++ b/captcha/image.py @@ -120,10 +120,10 @@ class ImageCaptcha(_Captcha): @staticmethod def create_noise_curve(image, color): w, h = image.size - x1 = random.randint(0, w / 5) - x2 = random.randint(w - w / 5, w) - y1 = random.randint(h / 5, h - h / 5) - y2 = random.randint(y1, h - h / 5) + x1 = random.randint(0, int(w / 5)) + x2 = random.randint(w - int(w / 5), w) + y1 = random.randint(h / 5, h - int(h / 5)) + y2 = random.randint(y1, h - int(h / 5)) points = [(x1, y1), (x2, y2)] end = random.randint(160, 200) start = random.randint(0, 20)