summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorIrit Katriel <1055913+iritkatriel@users.noreply.github.com>2022-10-07 21:41:35 (GMT)
committerGitHub <noreply@github.com>2022-10-07 21:41:35 (GMT)
commit34e6f3567e3519e0e8cdb7bbc4b68b9ab40493c8 (patch)
tree7c200854fd28185000051023611920c9405211b8 /Tools/clinic
parent3de08ce8c15ab21a010d3bb0618ac42d15c8eff0 (diff)
downloadcpython-34e6f3567e3519e0e8cdb7bbc4b68b9ab40493c8.zip
cpython-34e6f3567e3519e0e8cdb7bbc4b68b9ab40493c8.tar.gz
cpython-34e6f3567e3519e0e8cdb7bbc4b68b9ab40493c8.tar.bz2
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
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 30a6763..a8687e3 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -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()