File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 55
66from collections import namedtuple
77import os
8- from tornado import web
8+ from tornado import (
9+ gen , web ,
10+ )
911HTTPError = web .HTTPError
1012
1113from ..base .handlers import (
1214 IPythonHandler , FilesRedirectHandler , path_regex ,
1315)
14- from ..utils import url_escape
16+ from ..utils import (
17+ maybe_future , url_escape ,
18+ )
1519from ..transutils import _
1620
1721
@@ -68,6 +72,7 @@ def get_frontend_exporters():
6872class NotebookHandler (IPythonHandler ):
6973
7074 @web .authenticated
75+ @gen .coroutine
7176 def get (self , path ):
7277 """get renders the notebook template if a name is given, or
7378 redirects to the '/files/' handler if the name is not given."""
@@ -76,7 +81,7 @@ def get(self, path):
7681
7782 # will raise 404 on not found
7883 try :
79- model = cm .get (path , content = False )
84+ model = yield maybe_future ( cm .get (path , content = False ) )
8085 except web .HTTPError as e :
8186 if e .status_code == 404 and 'files' in path .split ('/' ):
8287 # 404, but '/files/' in URL, let FilesRedirect take care of it
You can’t perform that action at this time.
0 commit comments