File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,10 +112,7 @@ def convert(mo):
112112 # Check the most common path first.
113113 named = mo .group ('named' ) or mo .group ('braced' )
114114 if named is not None :
115- val = mapping [named ]
116- # We use this idiom instead of str() because the latter will
117- # fail if val is a Unicode containing non-ASCII characters.
118- return '%s' % (val ,)
115+ return str (mapping [named ])
119116 if mo .group ('escaped' ) is not None :
120117 return self .delimiter
121118 if mo .group ('invalid' ) is not None :
@@ -142,9 +139,7 @@ def convert(mo):
142139 named = mo .group ('named' ) or mo .group ('braced' )
143140 if named is not None :
144141 try :
145- # We use this idiom instead of str() because the latter
146- # will fail if val is a Unicode containing non-ASCII
147- return '%s' % (mapping [named ],)
142+ return str (mapping [named ])
148143 except KeyError :
149144 return mo .group ()
150145 if mo .group ('escaped' ) is not None :
You can’t perform that action at this time.
0 commit comments