]> granicus.if.org Git - python/commitdiff
Issue #21629: Fix Argument Clinic's "--converters" feature.
authorLarry Hastings <larry@hastings.org>
Wed, 11 Jun 2014 11:31:29 +0000 (04:31 -0700)
committerLarry Hastings <larry@hastings.org>
Wed, 11 Jun 2014 11:31:29 +0000 (04:31 -0700)
Misc/NEWS
Tools/clinic/clinic.py

index e718bcd12117315132a41f6e606396645dc9568a..4dbcc8c5aeebb3687df166fc82134a12b291c0b3 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -118,6 +118,11 @@ Windows
 - Issue #21671, CVE-2014-0224: The bundled version of OpenSSL has been
   updated to 1.0.1h.
 
+Tools/Demos
+-----------
+
+- Issue #21629: Fix Argument Clinic's "--converters" feature.
+
 
 What's New in Python 3.4.1?
 ===========================
index 68a14361fd2e66d72725449ae6d47908253a5c67..93e8f5a6b9ada8197aa63d2d109f0cf1124ff648 100755 (executable)
@@ -2044,11 +2044,9 @@ def add_default_legacy_c_converter(cls):
     # automatically add converter for default format unit
     # (but without stomping on the existing one if it's already
     # set, in case you subclass)
-    if ((cls.format_unit != 'O&') and
+    if ((cls.format_unit not in ('O&', '')) and
         (cls.format_unit not in legacy_converters)):
         legacy_converters[cls.format_unit] = cls
-        if cls.format_unit:
-            legacy_converters[cls.format_unit] = cls
     return cls
 
 def add_legacy_c_converter(format_unit, **kwargs):