Skip to content

Commit 93d163f

Browse files
committed
fix completion handling
1 parent a481add commit 93d163f

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

jupyter_console/completer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from traitlets.config import Configurable
88
from traitlets import Float
99

10-
from jupyter_client.utils import run_sync
10+
from jupyter_console.utils import run_sync
1111

1212

1313
class ZMQCompleter(Configurable):

jupyter_console/ptshell.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import sys
1414
from tempfile import TemporaryDirectory
1515
import time
16-
import typing as t
1716
from warnings import warn
1817

1918
from typing import Dict as DictType, Any as AnyType
@@ -31,7 +30,6 @@
3130
Instance,
3231
Any,
3332
)
34-
import inspect
3533
from traitlets.config import SingletonConfigurable
3634

3735
from .completer import ZMQCompleter
@@ -78,29 +76,7 @@
7876
from pygments.util import ClassNotFound
7977
from pygments.token import Token
8078

81-
from jupyter_core.utils import run_sync as _run_sync
82-
83-
84-
T = t.TypeVar("T")
85-
86-
87-
def run_sync(coro: t.Callable[..., t.Union[T, t.Awaitable[T]]]) -> t.Callable[..., T]:
88-
"""Wraps coroutine in a function that blocks until it has executed.
89-
90-
Parameters
91-
----------
92-
coro : coroutine-function
93-
The coroutine-function to be executed.
94-
95-
Returns
96-
-------
97-
result :
98-
Whatever the coroutine-function returns.
99-
"""
100-
if not inspect.iscoroutinefunction(coro):
101-
return t.cast(t.Callable[..., T], coro)
102-
return _run_sync(coro)
103-
79+
from jupyter_console.utils import run_sync
10480

10581

10682
def ask_yes_no(prompt, default=None, interrupt=None):

0 commit comments

Comments
 (0)