Projet

Général

Profil

0001-add-python-3-support-to-signature-check-25296.patch

Frédéric Péters, 16 juillet 2018 16:45

Télécharger (1,14 ko)

Voir les différences:

Subject: [PATCH] add python 3 support to signature check (#25296)

 hobo/signature.py | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
hobo/signature.py
5 5
import urllib
6 6
import random
7 7

  
8
from django.utils import six
8 9
from django.utils.encoding import smart_bytes
9 10
from django.utils.http import quote, urlencode
10 11
from django.utils.six.moves.urllib import parse as urlparse
......
69 70
    if len(signature2) != len(signature):
70 71
        return False
71 72
    res = 0
72
    for a, b in zip(signature, signature2):
73
        res |= ord(a) ^ ord(b)
73
    if six.PY3:
74
        for a, b in zip(signature, signature2):
75
            res |= a ^ b
76
    else:
77
        for a, b in zip(signature, signature2):
78
            res |= ord(a) ^ ord(b)
74 79
    return res == 0
75
-