summaryrefslogtreecommitdiffstats
path: root/Lib/dos-8x3/posixpat.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1997-11-26 15:44:34 (GMT)
committerGuido van Rossum <guido@python.org>1997-11-26 15:44:34 (GMT)
commit0b23348aa944dcb97c84b34d399c857f039e5773 (patch)
tree88178b09c8a16b93ab1ab174df968a61d36e7293 /Lib/dos-8x3/posixpat.py
parent330c660f66243094e082500bc1d760b2b86024cb (diff)
downloadcpython-0b23348aa944dcb97c84b34d399c857f039e5773.zip
cpython-0b23348aa944dcb97c84b34d399c857f039e5773.tar.gz
cpython-0b23348aa944dcb97c84b34d399c857f039e5773.tar.bz2
The usual
Diffstat (limited to 'Lib/dos-8x3/posixpat.py')
-rwxr-xr-xLib/dos-8x3/posixpat.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/dos-8x3/posixpat.py b/Lib/dos-8x3/posixpat.py
index 965184b..9960801 100755
--- a/Lib/dos-8x3/posixpat.py
+++ b/Lib/dos-8x3/posixpat.py
@@ -266,15 +266,15 @@ def expandvars(path):
if '$' not in path:
return path
if not _varprog:
- import regex
- _varprog = regex.compile('$\([a-zA-Z0-9_]+\|{[^}]*}\)')
+ import re
+ _varprog = re.compile(r'\$(\w+|\{[^}]*\})')
i = 0
while 1:
- i = _varprog.search(path, i)
- if i < 0:
+ m = _varprog.search(path, i)
+ if not m:
break
- name = _varprog.group(1)
- j = i + len(_varprog.group(0))
+ i, j = m.span(0)
+ name = m.group(1)
if name[:1] == '{' and name[-1:] == '}':
name = name[1:-1]
if os.environ.has_key(name):