From d77c72b1b6270102765c446181cb7750c8cf8b48 Mon Sep 17 00:00:00 2001 From: Tom Jarosz Date: Mon, 16 Sep 2019 09:52:17 -0700 Subject: [PATCH 1/2] Added decorator Added decorator `@gen.coroutine` to `FileHandler.get()` --- notebook/files/handlers.py | 1 + 1 file changed, 1 insertion(+) diff --git a/notebook/files/handlers.py b/notebook/files/handlers.py index 192de1f923..63e586f11b 100644 --- a/notebook/files/handlers.py +++ b/notebook/files/handlers.py @@ -35,6 +35,7 @@ def head(self, path): return self.get(path, include_body=False) @web.authenticated + @gen.coroutine def get(self, path, include_body=True): # /files/ requests must originate from the same site self.check_xsrf_cookie() From 6092b290f12b477b06e1e6f141d9425bb65dc68d Mon Sep 17 00:00:00 2001 From: Tom Jarosz Date: Mon, 16 Sep 2019 10:03:00 -0700 Subject: [PATCH 2/2] Import `gen` --- notebook/files/handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/files/handlers.py b/notebook/files/handlers.py index 63e586f11b..3b2570a185 100644 --- a/notebook/files/handlers.py +++ b/notebook/files/handlers.py @@ -7,7 +7,7 @@ import json from base64 import decodebytes -from tornado import web +from tornado import gen, web from notebook.base.handlers import IPythonHandler from notebook.utils import maybe_future