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 1414)
1515from .fileio import AsyncFileManagerMixin , FileManagerMixin
1616
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+
1823from jupyter_core .utils import ensure_dir_exists
1924from traitlets import Unicode
2025
Original file line number Diff line number Diff line change 1212import os
1313import shutil
1414
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+
1621from tornado .web import HTTPError
1722
1823from jupyter_server .utils import (
Original file line number Diff line number Diff line change 1212import mimetypes
1313import nbformat
1414
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+
1621from send2trash import send2trash
1722from tornado import web
1823
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+
27from tornado import web
38import base64
49import os , io
Original file line number Diff line number Diff line change @@ -42,7 +42,8 @@ install_requires =
4242 terminado>=0.8.3
4343 prometheus_client
4444 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'
4647
4748[options.extras_require]
4849test = 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