diff options
author | Larry Hastings <larry@hastings.org> | 2014-01-19 02:27:34 -0800 |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-01-19 02:27:34 -0800 |
commit | c4fe092bc34d0bed120ecf369684ece4afec6be0 (patch) | |
tree | b86ecbda8e00a7557831679a94fa2c3b883604f5 | |
parent | b7ccb204236dca49f3d8d119aa84631f519add09 (diff) | |
download | cpython-git-c4fe092bc34d0bed120ecf369684ece4afec6be0.tar.gz |
Issue #20300: Fix exception when setting conversion class member "default"
to None.
-rwxr-xr-x | Tools/clinic/clinic.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py index 4d58056b8a..84bc7b8a74 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: |