mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
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:
parent
4590c00e89
commit
8c72eae237
4 changed files with 24 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue