Skip to content

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

Description

@mikenerone

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/cpython@3.12.2/lib/python3.12/asyncio/unix_events.py", line 858, in __init_subclass__
    warnings._deprecated("AbstractChildWatcher",
  File "/Users/mikenerone/Library/Application Support/pdm/python/cpython@3.12.2/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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions