Fix randint for Python 3

This commit is contained in:
Hsiaoming Yang
2014-12-02 20:25:29 +08:00
parent 81a660f7e4
commit cfa87cb543

View File

@@ -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)