Show More
@@ -224,9 +224,9 def str_safe(arg): | |||||
224 | except Exception,msg: |
|
224 | except Exception,msg: | |
225 | # let's keep this little duplication here, so that the most common |
|
225 | # let's keep this little duplication here, so that the most common | |
226 | # case doesn't suffer from a double try wrapping. |
|
226 | # case doesn't suffer from a double try wrapping. | |
227 |
out = '<ERROR |
|
227 | out = '<ERROR: %s>' % msg | |
228 | except Exception,msg: |
|
228 | except Exception,msg: | |
229 |
out = '<ERROR |
|
229 | out = '<ERROR: %s>' % msg | |
230 | #raise # dbg |
|
230 | #raise # dbg | |
231 | return out |
|
231 | return out | |
232 |
|
232 |
@@ -196,7 +196,7 class Itpl: | |||||
196 | for live, chunk in self.chunks: |
|
196 | for live, chunk in self.chunks: | |
197 | if live: app(str(eval(chunk,glob,loc))) |
|
197 | if live: app(str(eval(chunk,glob,loc))) | |
198 | else: app(chunk) |
|
198 | else: app(chunk) | |
199 |
out = |
|
199 | out = ''.join(result) | |
200 | try: |
|
200 | try: | |
201 | return str(out) |
|
201 | return str(out) | |
202 | except UnicodeError: |
|
202 | except UnicodeError: | |
@@ -212,9 +212,6 class Itpl: | |||||
212 | loc, glob = frame.f_locals, frame.f_globals |
|
212 | loc, glob = frame.f_locals, frame.f_globals | |
213 |
|
213 | |||
214 | return self._str(glob,loc) |
|
214 | return self._str(glob,loc) | |
215 |
|
||||
216 | def encode(self, encoding, errors): |
|
|||
217 | return str(self)#.encode(encoding, errors) |
|
|||
218 |
|
215 | |||
219 | class ItplNS(Itpl): |
|
216 | class ItplNS(Itpl): | |
220 | """Class representing a string with interpolation abilities. |
|
217 | """Class representing a string with interpolation abilities. |
General Comments 0
You need to be logged in to leave comments.
Login now