Ticket #1852: template-print.diff
File template-print.diff, 839 bytes (added by , 19 years ago) |
---|
-
template/__init__.py
old new 90 90 builtins = [] 91 91 92 92 class TemplateSyntaxError(Exception): 93 pass 93 def __str__(self): 94 try: 95 import cStringIO as StringIO 96 except ImportError: 97 import StringIO 98 output = StringIO.StringIO() 99 output.write(Exception.__str__(self)) 100 # Check if we wrapped an exception and print that too. 101 if hasattr(self, 'exc_info'): 102 import traceback 103 output.write('\n\nOriginal ') 104 e = self.exc_info 105 traceback.print_exception(e[0], e[1], e[2], 500, output) 106 return output.getvalue() 94 107 95 108 class ContextPopException(Exception): 96 109 "pop() has been called more times than push()"