SF patch #1056967, changes the semantics of Template.safe_substitute() to not

raise a ValueError for dangling delimiters (the delimiter itself is returned).
This commit is contained in:
Barry Warsaw 2004-11-01 03:52:43 +00:00
parent 4590c00e89
commit 8c72eae237
4 changed files with 24 additions and 13 deletions

View file

@ -199,7 +199,7 @@ class Template:
if mo.group('escaped') is not None:
return self.delimiter
if mo.group('invalid') is not None:
self._invalid(mo)
return self.delimiter
raise ValueError('Unrecognized named group in pattern',
self.pattern)
return self.pattern.sub(convert, self.template)