]> granicus.if.org Git - python/commitdiff
#14344: fixed the repr of email.policy objects.
authorR David Murray <rdmurray@bitdance.com>
Sat, 17 Mar 2012 19:11:59 +0000 (15:11 -0400)
committerR David Murray <rdmurray@bitdance.com>
Sat, 17 Mar 2012 19:11:59 +0000 (15:11 -0400)
Lib/email/policy.py
Misc/NEWS

index 88877a2f456a3bc0702954e9ce27b6c2da3359e7..585a7528196ddcb07b1feb2629685570a9946d32 100644 (file)
@@ -52,7 +52,7 @@ class _PolicyBase:
     def __repr__(self):
         args = [ "{}={!r}".format(name, value)
                  for name, value in self.__dict__.items() ]
-        return "{}({})".format(self.__class__.__name__, args if args else '')
+        return "{}({})".format(self.__class__.__name__, ', '.join(args))
 
     def clone(self, **kw):
         """Return a new instance with specified attributes changed.
index 4c6a5c20238e797d913a01da0014068a851d1e31..93fb4bd5d991286ef787c9394195d2c0c939d63e 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -30,6 +30,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #14344: fixed the repr of email.policy objects.
+
 - Issue #11686: Added missing entries to email package __all__ lists
   (mostly the new Bytes classes).