Skip to content

Fix import on Python 3.14 and later - #166

Open
Samuel-Hills wants to merge 1 commit into
python-trio:masterfrom
Samuel-Hills:fix-python314-policy-import-160
Open

Samuel-Hills wants to merge 1 commit into
python-trio:masterfrom
Samuel-Hills:fix-python314-policy-import-160

Conversation

@Samuel-Hills

Copy link
Copy Markdown

Summary

Python 3.14 renamed asyncio.events.BaseDefaultEventLoopPolicy to the private _BaseDefaultEventLoopPolicy. trio_asyncio imported only the old public name, so importing the package failed before any event-loop functionality could be used.

This change accepts either name, retaining compatibility with older Python versions while allowing Python 3.14 and later to import normally. It adds an isolated subprocess regression test that imports the package with only the private name exposed, plus the required 160.bugfix.rst release fragment.

Closes #160.

Validation

  • Focused compatibility test: 1 passed, 17 deselected
  • Python compileall passed.
  • git diff --check passed.

The repository-wide flake8 invocation reports many pre-existing baseline violations in unrelated files; no new focused failure was identified.

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.

Failing to import on Python >= 3.14

1 participant