File tree Expand file tree Collapse file tree 5 files changed +26
-5
lines changed
jupyter_server/services/contents Expand file tree Collapse file tree 5 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 14
14
)
15
15
from .fileio import AsyncFileManagerMixin , FileManagerMixin
16
16
17
- from anyio .to_thread import run_sync
17
+ try :
18
+ from anyio .to_thread import run_sync
19
+ except ImportError :
20
+ # fallback on anyio v2 for python version < 3.7
21
+ from anyio import run_sync_in_worker_thread as run_sync
22
+
18
23
from jupyter_core .utils import ensure_dir_exists
19
24
from traitlets import Unicode
20
25
Original file line number Diff line number Diff line change 12
12
import os
13
13
import shutil
14
14
15
- from anyio .to_thread import run_sync
15
+ try :
16
+ from anyio .to_thread import run_sync
17
+ except ImportError :
18
+ # fallback on anyio v2 for python version < 3.7
19
+ from anyio import run_sync_in_worker_thread as run_sync
20
+
16
21
from tornado .web import HTTPError
17
22
18
23
from jupyter_server .utils import (
Original file line number Diff line number Diff line change 12
12
import mimetypes
13
13
import nbformat
14
14
15
- from anyio .to_thread import run_sync
15
+ try :
16
+ from anyio .to_thread import run_sync
17
+ except ImportError :
18
+ # fallback on anyio v2 for python version < 3.7
19
+ from anyio import run_sync_in_worker_thread as run_sync
20
+
16
21
from send2trash import send2trash
17
22
from tornado import web
18
23
Original file line number Diff line number Diff line change 1
- from anyio .to_thread import run_sync
1
+ try :
2
+ from anyio .to_thread import run_sync
3
+ except ImportError :
4
+ # fallback on anyio v2 for python version < 3.7
5
+ from anyio import run_sync_in_worker_thread as run_sync
6
+
2
7
from tornado import web
3
8
import base64
4
9
import os , io
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ install_requires =
42
42
terminado>=0.8.3
43
43
prometheus_client
44
44
pywin32>=1.0 ; sys_platform == 'win32'
45
- anyio>=3.0.1,<4
45
+ anyio>=2.0.2,<3 ; python_version < '3.7'
46
+ anyio>=3.0.1,<4 ; python_version >= '3.7'
46
47
47
48
[options.extras_require]
48
49
test = coverage; pytest; pytest-cov; pytest-mock; requests; pytest-tornasync; pytest-console-scripts; ipykernel
You can’t perform that action at this time.
0 commit comments