diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-03-07 12:55:46 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-03-07 12:55:46 -0800 |
commit | c646e7283225443d92712c3d559304b56085198f (patch) | |
tree | 337516d37af2af9b97148b770f641f1995360eed | |
parent | 3579f76dc7e08193af176ca428585fbc432a7142 (diff) |
Fix some Py2-isms in constant_time_bytes_eq
-rw-r--r-- | paramiko/util.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/paramiko/util.py b/paramiko/util.py index acd3fc69..0e582dc0 100644 --- a/paramiko/util.py +++ b/paramiko/util.py @@ -307,6 +307,6 @@ def constant_time_bytes_eq(a, b): if len(a) != len(b): return False res = 0 - for i in xrange(len(a)): - res |= ord(a[i]) ^ ord(b[i]) + for i in (xrange if PY2 else range)(len(a)): + res |= byte_ord(a[i]) ^ byte_ord(b[i]) return res == 0 |