From 97d642364672b2d3fcb45cfbe940c0e71ad8f54b Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Sun, 9 Sep 2012 15:43:24 -0700 Subject: [PATCH] Errors while rendering templates no longer log the generated code. 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 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tornado/template.py b/tornado/template.py index a7efa47e7..35bd1c23f 100644 --- a/tornado/template.py +++ b/tornado/template.py @@ -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() -- 2.47.2