]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Errors while rendering templates no longer log the generated code.
authorBen Darnell <ben@bendarnell.com>
Sun, 9 Sep 2012 22:43:24 +0000 (15:43 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 9 Sep 2012 22:43:24 +0000 (15:43 -0700)
Now that stack traces have source line info, the full code is hopefully
unnecessary (and if it is needed, this isn't the best way to get it).
Syntax errors in the generated code will still dump the whole thing
to the log.

tornado/template.py

index a7efa47e7497a01906ddcadf3be1f25f40f82017..35bd1c23f4dc5508dda5833a46c9936dc4f9e918 100644 (file)
@@ -257,12 +257,7 @@ class Template(object):
         # we've generated a new template (mainly for this module's
         # unittests, where different tests reuse the same name).
         linecache.clearcache()
-        try:
-            return execute()
-        except Exception:
-            formatted_code = _format_code(self.code).rstrip()
-            app_log.error("%s code:\n%s", self.name, formatted_code)
-            raise
+        return execute()
 
     def _generate_python(self, loader, compress_whitespace):
         buffer = cStringIO.StringIO()