#2650: Merge with 3.1.

This commit is contained in:
Ezio Melotti 2011-03-25 14:25:36 +02:00
commit 213eb96902
2 changed files with 55 additions and 23 deletions

View file

@ -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"