summaryrefslogtreecommitdiffstats
path: root/Mac/Tools/IDE/PyBrowser.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2001-02-21 13:54:31 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2001-02-21 13:54:31 (GMT)
commit9ad2752381b10cae83eb9e8044aa77dfd87d7039 (patch)
treee06b55db8ff39a445a6dcc83622fc229348d0582 /Mac/Tools/IDE/PyBrowser.py
parent2d0589be6739e15bc27ab8996ee0727a5a3dda51 (diff)
downloadcpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.zip
cpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.tar.gz
cpython-9ad2752381b10cae83eb9e8044aa77dfd87d7039.tar.bz2
Use re in stead of regex, so we get rid of the annoying warning during startup.
Diffstat (limited to 'Mac/Tools/IDE/PyBrowser.py')
-rw-r--r--Mac/Tools/IDE/PyBrowser.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/Mac/Tools/IDE/PyBrowser.py b/Mac/Tools/IDE/PyBrowser.py
index c1abbac..853392f 100644
--- a/Mac/Tools/IDE/PyBrowser.py
+++ b/Mac/Tools/IDE/PyBrowser.py
@@ -3,7 +3,7 @@ import Wkeys
import struct
import string
import types
-import regex
+import re
nullid = '\0\0'
closedid = struct.pack('h', 468)
@@ -13,11 +13,15 @@ opensolidid = struct.pack('h', 471)
arrows = (nullid, closedid, openid, closedsolidid, opensolidid)
-has_ctlcharsRE = regex.compile('[\000-\037\177-\377]')
-
+has_ctlcharsRE = re.compile('[\000-\037\177-\377]')
+def ctlcharsREsearch(str):
+ if has_ctlcharsRE(str) is None:
+ return -1
+ return 1
+
def double_repr(key, value, truncvalue = 0,
type = type, StringType = types.StringType,
- has_ctlchars = has_ctlcharsRE.search, _repr = repr, str = str):
+ has_ctlchars = ctlcharsREsearch, _repr = repr, str = str):
if type(key) == StringType and has_ctlchars(key) < 0:
key = str(key)
else: