trio-asyncio icon indicating copy to clipboard operation
trio-asyncio copied to clipboard

TrioChildWatcher inherits asyncio.AbstractChildWatcher, which is deprecated as of Python 3.12

Open mikenerone opened this issue 1 year ago • 1 comments

Per deprecations listed in What's New In Python 3.12, asyncio.AbstractChildWatcher is deprecated. TrioChildWatcher in trio-asyncio inherits it, leading to warnings with Python 3.12.

This is demonstrated in any 3.12 environment:

❯ python -W error -c "import trio_asyncio"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/mikenerone/dev/nexhealth/nexhealth-sync-system/nexhealth-sync-modmed/.venv/lib/python3.12/site-packages/trio_asyncio/__init__.py", line 19, in <module>
    from ._loop import (
  File "/Users/mikenerone/dev/nexhealth/nexhealth-sync-system/nexhealth-sync-modmed/.venv/lib/python3.12/site-packages/trio_asyncio/_loop.py", line 365, in <module>
    class TrioChildWatcher(
  File "/Users/mikenerone/Library/Application Support/pdm/python/[email protected]/lib/python3.12/asyncio/unix_events.py", line 858, in __init_subclass__
    warnings._deprecated("AbstractChildWatcher",
  File "/Users/mikenerone/Library/Application Support/pdm/python/[email protected]/lib/python3.12/warnings.py", line 530, in _deprecated
    warn(msg, DeprecationWarning, stacklevel=3)
DeprecationWarning: 'AbstractChildWatcher' is deprecated as of Python 3.12 and will be removed in Python 3.14.

mikenerone avatar May 24 '24 02:05 mikenerone

Context for the deprecation is at https://github.com/python/cpython/issues/94597.

jmehnle avatar Jun 06 '24 00:06 jmehnle