[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem] 07/20: Fix undefined name 'xrange'



This is an automated email from the git hooks/post-receive script.

atagar pushed a commit to branch maint
in repository stem.

commit 2003eba9a545a31d528b05174be9489c0489fe33
Author: juga <juga@xxxxxxxxxx>
AuthorDate: Wed May 31 07:25:28 2023 +0000

    Fix undefined name 'xrange'
    
    by removing support for Python versions < 3.
---
 stem/util/ed25519.py | 23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/stem/util/ed25519.py b/stem/util/ed25519.py
index 67b2db3c..a05e1701 100644
--- a/stem/util/ed25519.py
+++ b/stem/util/ed25519.py
@@ -41,29 +41,12 @@ arithmetic, so we cannot handle secrets without risking their disclosure.
 
 import hashlib
 import operator
-import sys
-
 
 __version__ = "1.0.dev0"
 
-
-# Useful for very coarse version differentiation.
-PY3 = sys.version_info[0] == 3
-
-if PY3:
-    indexbytes = operator.getitem
-    intlist2bytes = bytes
-    int2byte = operator.methodcaller("to_bytes", 1, "big")
-else:
-    int2byte = chr
-    range = xrange
-
-    def indexbytes(buf, i):
-        return ord(buf[i])
-
-    def intlist2bytes(l):
-        return b"".join(chr(c) for c in l)
-
+indexbytes = operator.getitem
+intlist2bytes = bytes
+int2byte = operator.methodcaller("to_bytes", 1, "big")
 
 b = 256
 q = 2 ** 255 - 19

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits