From d49643b5ca5f6e1dbb9cff99a67529010b8c05ff Mon Sep 17 00:00:00 2001 From: Zhicheng Wei Date: Mon, 22 Feb 2016 16:02:01 +0800 Subject: [PATCH] render() should raise an error when finish() already called --- tornado/web.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tornado/web.py b/tornado/web.py index 8826c62b0..d1cb7391a 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -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 -- 2.47.2