From: Larry Hastings Date: Sun, 12 Jan 2014 16:49:30 +0000 (-0800) Subject: Issue #20196: Fixed a bug where Argument Clinic did not generate correct X-Git-Tag: v3.4.0b3~170 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=583baa8fef6b69d32b8c41b777c879e387ea46e3;p=thirdparty%2FPython%2Fcpython.git Issue #20196: Fixed a bug where Argument Clinic did not generate correct parsing code for functions with positional-only parameters where all arguments are optional. --- diff --git a/Misc/NEWS b/Misc/NEWS index d73137eb40ac..d6be619d2f1c 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -72,6 +72,10 @@ Tests Tools/Demos ----------- +- Issue #20196: Fixed a bug where Argument Clinic did not generate correct + parsing code for functions with positional-only parameters where all arguments + are optional. + - Issue #18960: 2to3 and the findnocoding.py script now ignore the source encoding declaration on the second line if the first line contains anything except a comment. diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 421b9e3d3969..cd7c597f5335 100755 --- a/Tools/clinic/clinic.py +++ b/Tools/clinic/clinic.py @@ -591,6 +591,12 @@ static {impl_return_type} count_min = min(count_min, count) count_max = max(count_max, count) + if count == 0: + add(""" case 0: + break; +""") + continue + group_ids = {p.group for p in subset} # eliminate duplicates d = {} d['count'] = count