summaryrefslogtreecommitdiffstats
path: root/Tools/clinic
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-01-19 05:54:15 (GMT)
committerLarry Hastings <larry@hastings.org>2014-01-19 05:54:15 (GMT)
commitb470575e2492349584d9afa2a9d581b58ee92c38 (patch)
treecfd3e51b261f2a6b0f89d98b9c2687831ed71016 /Tools/clinic
parentdc3cce077d31b613bee8bc07d9c97bf63a2304f3 (diff)
downloadcpython-b470575e2492349584d9afa2a9d581b58ee92c38.zip
cpython-b470575e2492349584d9afa2a9d581b58ee92c38.tar.gz
cpython-b470575e2492349584d9afa2a9d581b58ee92c38.tar.bz2
Issue #20299: Argument Clinic custom converters may now change the default
value of c_default and py_default with a class member.
Diffstat (limited to 'Tools/clinic')
-rwxr-xr-xTools/clinic/clinic.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index 0987d56..ba0bc17 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -1893,8 +1893,10 @@ class CConverter(metaclass=CConverterAutoRegister):
self.__class__.__name__, default, name, types_str))
self.default = default
- self.c_default = c_default
- self.py_default = py_default
+ if c_default:
+ self.c_default = c_default
+ if py_default:
+ self.py_default = py_default
if annotation != unspecified:
fail("The 'annotation' parameter is not currently permitted.")