summaryrefslogtreecommitdiffstats
path: root/Lib/sre_compile.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/sre_compile.py')
-rw-r--r--Lib/sre_compile.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py
index 4f2fb04..6b28052 100644
--- a/Lib/sre_compile.py
+++ b/Lib/sre_compile.py
@@ -318,7 +318,7 @@ def _optimize_unicode(charset, fixup):
elif op is LITERAL:
charmap[fixup(av)] = 1
elif op is RANGE:
- for i in xrange(fixup(av[0]), fixup(av[1])+1):
+ for i in range(fixup(av[0]), fixup(av[1])+1):
charmap[i] = 1
elif op is CATEGORY:
# XXX: could expand category
@@ -330,13 +330,13 @@ def _optimize_unicode(charset, fixup):
if sys.maxunicode != 65535:
# XXX: negation does not work with big charsets
return charset
- for i in xrange(65536):
+ for i in range(65536):
charmap[i] = not charmap[i]
comps = {}
mapping = [0]*256
block = 0
data = []
- for i in xrange(256):
+ for i in range(256):
chunk = tuple(charmap[i*256:(i+1)*256])
new = comps.setdefault(chunk, block)
mapping[i] = new
@@ -461,7 +461,7 @@ def _compile_info(code, pattern, flags):
code.extend(prefix)
# generate overlap table
table = [-1] + ([0]*len(prefix))
- for i in xrange(len(prefix)):
+ for i in range(len(prefix)):
table[i+1] = table[i]+1
while table[i+1] > 0 and prefix[i] != prefix[table[i+1]-1]:
table[i+1] = table[table[i+1]-1]+1