Browse Source

remove unnecessary decorator web.asynchronous, call self.write instead.

shengjun yu 11 years ago
parent
commit
5560342236
1 changed files with 1 additions and 2 deletions
  1. 1 2
      tornado/server.py

+ 1 - 2
tornado/server.py

@@ -34,7 +34,6 @@ class PlaintextHandler(BaseHandler):
         self.write(b"Hello, World!")
         self.write(b"Hello, World!")
 
 
 class QueryTestHandler(BaseHandler):
 class QueryTestHandler(BaseHandler):
-    @tornado.web.asynchronous
     @gen.coroutine
     @gen.coroutine
     def get(self):
     def get(self):
         queries = int(self.get_argument("queries", 0))
         queries = int(self.get_argument("queries", 0))
@@ -55,7 +54,7 @@ class QueryTestHandler(BaseHandler):
                 worlds.append(world)
                 worlds.append(world)
             response = json.dumps(worlds)
             response = json.dumps(worlds)
         self.set_header("Content-Type", "application/json; charset=UTF-8")
         self.set_header("Content-Type", "application/json; charset=UTF-8")
-        self.finish(response)
+        self.write(response)
 
 
 application = tornado.web.Application([
 application = tornado.web.Application([
     (r"/json", JsonSerializeTestHandler),
     (r"/json", JsonSerializeTestHandler),