Skip to content

Commit ca29dc9

Browse files
committed
enabling top level await in iPython
1 parent cc2118b commit ca29dc9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

piccolo/apps/playground/commands/run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,7 @@ def run(
175175
print("\n")
176176

177177
populate()
178-
IPython.embed()
178+
179+
from IPython.core.interactiveshell import _asyncio_runner
180+
181+
IPython.embed(using=_asyncio_runner)

piccolo/apps/shell/commands/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ def start_ipython_shell(**tables: t.Dict[str, t.Type[Table]]):
1919
if table_class_name not in existing_global_names:
2020
globals()[table_class_name] = table_class
2121

22-
IPython.embed()
22+
from IPython.core.interactiveshell import _asyncio_runner
23+
24+
IPython.embed(using=_asyncio_runner)
2325

2426

2527
def run():

0 commit comments

Comments
 (0)