Skip to content

fix(api): guard lazy import exit hook - #861

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/python315-lazy-import
Oct 18, 2026
Merged

gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/python315-lazy-import

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

The Python 3.15 runtime reported in #860 lacks types.LazyImportType. Creating a lock registers an exit hook that later raises AttributeError when it tries to read that attribute.

Fixes #860 by registering the hook only when the lazy import proxy type exists. Runtimes with the type retain the shutdown handling; runtimes without it avoid the failing callback.

The Python 3.15 runtime in tox-dev#860 lacks types.LazyImportType, but lock
construction still registers a hook that reads it at exit. Check for
the type before registering the hook.
@gaborbernat
gaborbernat enabled auto-merge (squash) October 18, 2026 16:47
@gaborbernat
gaborbernat merged commit cb8b57e into tox-dev:main Oct 18, 2026
44 checks passed
@gaborbernat
gaborbernat deleted the fix/python315-lazy-import branch October 28, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for Python 3.15

1 participant