summaryrefslogtreecommitdiffstats
path: root/Lib/pre.py
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-02-10 00:22:33 (GMT)
committerEric S. Raymond <esr@thyrsus.com>2001-02-10 00:22:33 (GMT)
commit6e025bcde84ec358734a116cefcc4acc357ee0b1 (patch)
tree0e9d1e6ec181e63e8a88d7af05e2e9e49f2ca294 /Lib/pre.py
parentc8c6aa201f03393ada787a1bde88cd2092d2361c (diff)
downloadcpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.zip
cpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.tar.gz
cpython-6e025bcde84ec358734a116cefcc4acc357ee0b1.tar.bz2
String method cleanup.
Diffstat (limited to 'Lib/pre.py')
-rw-r--r--Lib/pre.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/Lib/pre.py b/Lib/pre.py
index c385824..35d3e3a 100644
--- a/Lib/pre.py
+++ b/Lib/pre.py
@@ -85,7 +85,6 @@ This module also defines an exception 'error'.
import sys
-import string
from pcre import *
#
@@ -223,10 +222,9 @@ def escape(pattern):
"""
result = list(pattern)
- alphanum=string.letters+'_'+string.digits
for i in range(len(pattern)):
char = pattern[i]
- if char not in alphanum:
+ if not char.isalnum():
if char=='\000': result[i] = '\\000'
else: result[i] = '\\'+char
return ''.join(result)