changeset 28501:00a56fbea69f 2.2

Backporting: revision 1.27 date: 2003/03/30 20:46:47; author: bwarsaw; state: Exp; lines: +3 -3 __unicode__(): Fix the logic for calculating whether to add a separating space or not between encoded chunks. Closes SF bug #710498.
author Barry Warsaw <barry@python.org>
date Fri, 04 Apr 2003 02:46:38 +0000
parents 42dfa0891b33
children 0fcf9ae25cfe
files Lib/email/Header.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Lib/email/Header.py	Thu Apr 03 23:02:29 2003 +0000
+++ b/Lib/email/Header.py	Fri Apr 04 02:46:38 2003 +0000
@@ -215,11 +215,11 @@
             # charset.  Only do this for the second and subsequent chunks.
             nextcs = charset
             if uchunks:
-                if lastcs is not None:
-                    if nextcs is None or nextcs == 'us-ascii':
+                if lastcs not in (None, 'us-ascii'):
+                    if nextcs in (None, 'us-ascii'):
                         uchunks.append(USPACE)
                         nextcs = None
-                elif nextcs is not None and nextcs <> 'us-ascii':
+                elif nextcs not in (None, 'us-ascii'):
                     uchunks.append(USPACE)
             lastcs = nextcs
             uchunks.append(unicode(s, str(charset)))