]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
render() should raise an error when finish() already called 1648/head
authorZhicheng Wei <zhicheng@opensourceforge.net>
Mon, 22 Feb 2016 08:02:01 +0000 (16:02 +0800)
committerZhicheng Wei <zhicheng@opensourceforge.net>
Mon, 22 Feb 2016 08:02:01 +0000 (16:02 +0800)
tornado/web.py

index 8826c62b0dab6aa6381f44c06c0e02ca9df5d043..d1cb7391a313bfb0e58aa4bf480bbf8353aeb484 100644 (file)
@@ -696,6 +696,8 @@ class RequestHandler(object):
 
     def render(self, template_name, **kwargs):
         """Renders the template with the given arguments as the response."""
+        if self._finished:
+            raise RuntimeError("Cannot render() after finish()")
         html = self.render_string(template_name, **kwargs)
 
         # Insert the additional JS and CSS added by the modules on the page