summaryrefslogtreecommitdiff
path: root/Lib/re.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-03-25 14:26:56 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2011-03-25 14:26:56 +0200
commitfd2c2a5271a00795372e9dae22a4c20d8d0807cf (patch)
tree7145f0d41eeccfcf248c67a7bf3b71ba402617fa /Lib/re.py
parent518b5aea1a1ddb649c242ae507b3c7b9f0c6edb3 (diff)
parent213eb96902387dd1f5af0f5f1b80f3d227fd0186 (diff)
downloadcpython-git-fd2c2a5271a00795372e9dae22a4c20d8d0807cf.tar.gz
#2650: Merge with 3.2.
Diffstat (limited to 'Lib/re.py')
-rw-r--r--Lib/re.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/re.py b/Lib/re.py
index 92e4e4c14b..abd7ea27b3 100644
--- a/Lib/re.py
+++ b/Lib/re.py
@@ -224,8 +224,7 @@ def escape(pattern):
if isinstance(pattern, str):
alphanum = _alphanum_str
s = list(pattern)
- for i in range(len(pattern)):
- c = pattern[i]
+ for i, c in enumerate(pattern):
if c not in alphanum:
if c == "\000":
s[i] = "\\000"