-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
I am dealing with InquirerPy within an asyncio task something like:
import asyncio
from InquirerPy import inquirer
async def main():
# Await... Something async...
selected = inquirer.fuzzy(
message="Select or Type a genre:",
choices=['a', 'b', 'c']
).execute()
print(selected)
if __name__ == '__main__':
asyncio.run(main())In any case I receive this kind of error:
selected = await inquirer.fuzzy(
File "/usr/local/lib/python3.9/site-packages/InquirerPy/base/simple.py", line 321, in execute
result = self._run()
File "/usr/local/lib/python3.9/site-packages/InquirerPy/base/complex.py", line 205, in _run
return self.application.run()
File "/usr/local/lib/python3.9/site-packages/prompt_toolkit/application/application.py", line 890, in run
return loop.run_until_complete(
File "/usr/local/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 618, in run_until_complete
self._check_running()
File "/usr/local/Cellar/python@3.9/3.9.8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 578, in _check_running
raise RuntimeError('This event loop is already running')
RuntimeError: This event loop is already running
sys:1: RuntimeWarning: coroutine 'Application.run_async' was never awaited
Is there a better way to avoid this error instead of using nest-asyncio like libraries?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request