Commit 23b8ff85 authored by mj's avatar mj

The 'if not self._valid(ref)' branch is *always* executed because ref still...

The 'if not self._valid(ref)' branch is *always* executed because ref still includes the ${} substitution marker around it. Update the _valid regular expression to include the markers, shaving off 4 tests for every substitution.

git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@83762 62d5b8a3-27da-0310-9561-8e5933582275
parent 581a8749
......@@ -910,7 +910,7 @@ class Options(UserDict.DictMixin):
_template_split = re.compile('([$]{[^}]*})').split
_simple = re.compile('[-a-zA-Z0-9 ._]+$').match
_valid = re.compile('[-a-zA-Z0-9 ._]+:[-a-zA-Z0-9 ._]+$').match
_valid = re.compile('\${[-a-zA-Z0-9 ._]+:[-a-zA-Z0-9 ._]+}$').match
def _sub(self, template, seen):
value = self._template_split(template)
subs = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment