File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 22# Distributed under the terms of the Modified BSD License.
33"""Tornado handlers for kernel specs."""
44
5- from tornado import web
5+ from tornado import gen , web
66from ..mixins import TokenAuthorizationMixin , CORSMixin , JSONErrorsMixin
77import os
88
@@ -22,12 +22,14 @@ def initialize(self):
2222 """
2323 web .StaticFileHandler .initialize (self , path = os .path .dirname (__file__ ))
2424
25+ @gen .coroutine
2526 def get (self ):
2627 """Handler for a get on a specific handler
2728 """
2829 resource_name , content_type = self .get_resource_metadata ()
2930 self .set_header ('Content-Type' , content_type )
30- return web .StaticFileHandler .get (self , resource_name )
31+ res = web .StaticFileHandler .get (self , resource_name )
32+ yield gen .maybe_future (res )
3133
3234 def options (self , ** kwargs ):
3335 """Method for properly handling CORS pre-flight"""
Original file line number Diff line number Diff line change @@ -260,5 +260,7 @@ def initialize(self, path):
260260 self .dirname , self .filename = os .path .split (path )
261261 super (NotebookDownloadHandler , self ).initialize (self .dirname )
262262
263+ @gen .coroutine
263264 def get (self , include_body = True ):
264- super (NotebookDownloadHandler , self ).get (self .filename , include_body )
265+ res = super (NotebookDownloadHandler , self ).get (self .filename , include_body )
266+ yield gen .maybe_future (res )
You can’t perform that action at this time.
0 commit comments