Skip to content

gh-92886: Remove assert in clinic.permute_optional_groups so that it works when running with optimizations #93228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove assert in :func:`clinic.permute_optional_groups` so that it works as intended, and tests pass, when running with optimizations (``-O``).
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove assert in :func:`clinic.permute_optional_groups` so that it works as intended, and tests pass, when running with optimizations (``-O``).
4 changes: 2 additions & 2 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,8 @@ def permute_optional_groups(left, required, right):
required = tuple(required)
result = []

if not required:
assert not left
if not required and left:
raise AssertionError('If required is empty, left must also be empty.')

accumulator = []
counts = set()
Expand Down