summaryrefslogtreecommitdiff
path: root/Lib/re.py
diff options
context:
space:
mode:
authorEzio Melotti <ezio.melotti@gmail.com>2011-03-25 14:25:36 +0200
committerEzio Melotti <ezio.melotti@gmail.com>2011-03-25 14:25:36 +0200
commit213eb96902387dd1f5af0f5f1b80f3d227fd0186 (patch)
tree21440775038c38ab46b423af0f7ea6ff1bcac18b /Lib/re.py
parent32a95a70c919be46f1fa65e0b4d98368cda768e6 (diff)
parentebbf1e67a8c56a79ee62280d32517e77b103bf8e (diff)
downloadcpython-git-213eb96902387dd1f5af0f5f1b80f3d227fd0186.tar.gz
#2650: Merge with 3.1.
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"