Skip to content

[pylint] Gate ImportCycleError on Python 3.15 (PLW0133) - #28310

Merged
ntBre merged 1 commit into
astral-sh:mainfrom
gorewilliams:fix-plw0133-import-cycle-error-version
Sep 4, 2026
Merged

ntBre merged 1 commit into
astral-sh:mainfrom
gorewilliams:fix-plw0133-import-cycle-error-version

Conversation

@gorewilliams

Copy link
Copy Markdown
Contributor

Fix PLW0133's Python version gating for ImportCycleError.

ImportCycleError was added in Python 3.15, but Ruff currently treats it as available starting in Python 3.13.

This updates the builtin exception classification so that:

  • PythonFinalizationError remains available for Python 3.13+
  • ImportCycleError is only considered available for Python 3.15+

Also adds regression coverage for the behavior across target Python versions.

Closes part of #28206.

@astral-sh-bot
astral-sh-bot Bot requested a review from ntBre September 4, 2026 11:11
@astral-sh-bot

astral-sh-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

ecosystem-analyzer results

No diagnostic changes detected ✅

Flaky changes detected. This PR summary excludes flaky changes; see the HTML report for details.

Full report with detailed diff (timing results)

@astral-sh-bot

astral-sh-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@ntBre ntBre mentioned this pull request Sep 4, 2026
27 of 32 tasks

@ntBre ntBre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, the code change looks correct. I just had a couple of suggestions about the testing setup.

@ntBre ntBre added bug An issue describing something that isn't working, or a PR that fixes a bug rule Implementing or modifying a lint rule python315 Related to Python 3.15 labels Sep 4, 2026
@gorewilliams
gorewilliams force-pushed the fix-plw0133-import-cycle-error-version branch from 7bf5c29 to 84363a3 Compare September 4, 2026 19:33
@gorewilliams
gorewilliams requested a review from ntBre September 4, 2026 19:40

@ntBre ntBre left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@ntBre
ntBre merged commit 118c14f into astral-sh:main Sep 4, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue describing something that isn't working, or a PR that fixes a bug python315 Related to Python 3.15 rule Implementing or modifying a lint rule

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants