You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SyntaxError in maths/greatest_common_divisor.py — invalid Python 3 except clause #14929
except A, B: is Python 2 syntax; in Python 3 the exception list must be parenthesised (except (A, B):). The module raises SyntaxError at import time, so it is completely unusable:
$ python3 -c "import maths.greatest_common_divisor"
File "maths/greatest_common_divisor.py", line 76
except IndexError, UnboundLocalError, ValueError:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: multiple exception types must be parenthesized
The failure also breaks downstream modules that depend on greatest_common_divisor:
maths/least_common_multiple.py (from maths.greatest_common_divisor import greatest_common_divisor) — fails to import.
maths/primelib.py — same.
Root cause
Introduced by the pre-commit autoupdate in commit 840ca00 ("[pre-commit.ci] pre-commit autoupdate (#14325)"). That commit updated astral-sh/ruff-pre-commit from v0.14.14 to v0.15.4, and the new ruff version rewrote the previously-correct except (IndexError, UnboundLocalError, ValueError): into the unparenthesised form. The regression affected several other files in the same commit:
This issue tracks the fix for maths/greatest_common_divisor.py specifically (per the one-file-per-PR rule). The wider ruff regression may deserve a separate tracker.
Suggested fix
Restore the parenthesised form. A PR is being opened.
@thejesh23 You should be deeply ashamed of creating this erroneous issue because it has caused at least 6 pull requests that have zero files changed.
You are wasting your time and the time of many others. You are unnecessarily using the planet’s resources by believing and acting on AI hallucinations.
This behavior is causing a wave of maintainers of Open Source projects to burn out and stop maintaining their valuable work.
When you create a pull request that has zero files changed on this repo, that means that the ruff linter knows Python 3 syntax better than you and your AI. It is fixing your mistakes.
Please install ruff on your computer and run it on your changes.
Activity
cclauss commentedon Aug 2, 2026
@thejesh23 You should be deeply ashamed of creating this erroneous issue because it has caused at least 6 pull requests that have zero files changed.
You are wasting your time and the time of many others. You are unnecessarily using the planet’s resources by believing and acting on AI hallucinations.
This behavior is causing a wave of maintainers of Open Source projects to burn out and stop maintaining their valuable work.
When you create a pull request that has zero files changed on this repo, that means that the ruff linter knows Python 3 syntax better than you and your AI. It is fixing your mistakes.
Please install
ruffon your computer and run it on your changes.https://docs.astral.sh/ruff/formatter