Skip to content

Commit 9f8da07

Browse files
author
Russell Hole
committed
Added workaround for asyncio bug
prompt-toolkit/python-prompt-toolkit#1023
1 parent 2becd11 commit 9f8da07

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cbrcli.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@
3636
print("Please upgrade your version of prompt_toolkit (pip install --upgrade prompt-toolkit)")
3737
sys.exit(1)
3838

39+
# Asyncio bug workaround
40+
# https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1023
41+
import asyncio
42+
import selectors
43+
44+
selector = selectors.SelectSelector()
45+
loop = asyncio.SelectorEventLoop(selector)
46+
asyncio.set_event_loop(loop)
47+
# End workaround
48+
3949
PYTHON_VERSION = sys.version_info[0]
4050

4151
modes = {

0 commit comments

Comments
 (0)