Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Python 3.11 #5

Merged
merged 3 commits into from
Oct 20, 2023
Merged

Supporting Python 3.11 #5

merged 3 commits into from
Oct 20, 2023

Conversation

lietu
Copy link
Contributor

@lietu lietu commented Oct 20, 2023

Before patches crashes with something like:

Traceback (most recent call last):
  File "/usr/local/bin/multi-start", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/pipx/venvs/multi-start/lib/python3.11/site-packages/src/cli.py", line 101, in main
    asyncio.run(
  File "/usr/lib/python3.11/asyncio/runners.py", line 188, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 120, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 650, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/pipx/venvs/multi-start/lib/python3.11/site-packages/src/starter.py", line 201, in start
    await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
  File "/usr/lib/python3.11/asyncio/tasks.py", line 420, in wait
    raise TypeError("Passing coroutines is forbidden, use tasks explicitly.")
TypeError: Passing coroutines is forbidden, use tasks explicitly.
sys:1: RuntimeWarning: coroutine 'Event.wait' was never awaited
sys:1: RuntimeWarning: coroutine 'Process.wait' was never awaited

After patch works fine. Not really sure why Python devs would prefer adding extra boilerplate, but it works with both old and new versions, supported in this form in 3.7+.

lietu added 2 commits October 20, 2023 14:31
…d idea for Python developers I have no idea. Also improved README. Might do a better job at shutting down tasks on errors.
@lietu
Copy link
Contributor Author

lietu commented Oct 20, 2023

@lietu lietu merged commit 151479f into main Oct 20, 2023
@lietu lietu mentioned this pull request Oct 20, 2023
@lietu lietu deleted the feature/py3.11-support branch November 14, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants