mirror of
https://github.com/lepture/captcha.git
synced 2026-03-13 09:43:22 +08:00
Fix randint for Python 3
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user