[Python-checkins] cpython: Issue #20300: Fix exception when setting conversion class member "default"

larry.hastings python-checkins at python.org
Sun Jan 19 11:28:00 CET 2014


http://hg.python.org/cpython/rev/cc53c49d38c8
changeset: 88571:cc53c49d38c8
user: Larry Hastings <larry at hastings.org>
date: Sun Jan 19 02:27:34 2014 -0800
summary:
 Issue #20300: Fix exception when setting conversion class member "default"
to None.
files:
 Tools/clinic/clinic.py | 6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3446,8 +3446,10 @@
 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:
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /