Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 542b7d1

Browse files
committed
#17265: merge with 3.3.
2 parents d8bc0a3 + 4d6795e commit 542b7d1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/library/string.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ these rules. The methods of :class:`Template` are:
688688
This is the object passed to the constructor's *template* argument. In
689689
general, you shouldn't change it, but read-only access is not enforced.
690690

691-
Here is an example of how to use a Template:
691+
Here is an example of how to use a Template::
692692

693693
>>> from string import Template
694694
>>> s = Template('$who likes $what')
@@ -697,11 +697,11 @@ Here is an example of how to use a Template:
697697
>>> d = dict(who='tim')
698698
>>> Template('Give $who $100').substitute(d)
699699
Traceback (most recent call last):
700-
[...]
700+
...
701701
ValueError: Invalid placeholder in string: line 1, col 11
702702
>>> Template('$who likes $what').substitute(d)
703703
Traceback (most recent call last):
704-
[...]
704+
...
705705
KeyError: 'what'
706706
>>> Template('$who likes $what').safe_substitute(d)
707707
'tim likes $what'

0 commit comments

Comments
 (0)