gh-92886: [clinic.py] raise exception on invalid input instead of assertion (GH-98051)

Tests should pass with -O (assertions off).

Automerge-Triggered-By: GH:iritkatriel
This commit is contained in:
Irit Katriel 2022-10-07 22:41:35 +01:00 committed by GitHub
parent 3de08ce8c1
commit 34e6f3567e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -495,7 +495,8 @@ def permute_optional_groups(left, required, right):
result = []
if not required:
assert not left
if left:
raise ValueError("required is empty but left is not")
accumulator = []
counts = set()