From: Ben Darnell Date: Sun, 9 Sep 2012 22:43:24 +0000 (-0700) Subject: Errors while rendering templates no longer log the generated code. X-Git-Tag: v3.0.0~272^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97d642364672b2d3fcb45cfbe940c0e71ad8f54b;p=thirdparty%2Ftornado.git 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. --- 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()