summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorLarry Hastings <larry@hastings.org>2014-01-19 10:27:34 (GMT)
committerLarry Hastings <larry@hastings.org>2014-01-19 10:27:34 (GMT)
commitc4fe092bc34d0bed120ecf369684ece4afec6be0 (patch)
treeb86ecbda8e00a7557831679a94fa2c3b883604f5 /Tools
parentb7ccb204236dca49f3d8d119aa84631f519add09 (diff)
downloadcpython-c4fe092bc34d0bed120ecf369684ece4afec6be0.zip
cpython-c4fe092bc34d0bed120ecf369684ece4afec6be0.tar.gz
cpython-c4fe092bc34d0bed120ecf369684ece4afec6be0.tar.bz2
Issue #20300: Fix exception when setting conversion class member "default"
to None.
Diffstat (limited to 'Tools')
-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 4d58056..84bc7b8 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3446,8 +3446,10 @@ class DSLParser:
a = [p.name]
if p.converter.is_optional():
a.append('=')
- value = p.converter.default
- a.append(p.converter.py_default)
+ value = p.converter.py_default
+ if not value:
+ value = str(p.converter.default)
+ a.append(value)
s = fix_right_bracket_count(p.right_bracket_count)
s += "".join(a)
if add_comma: