changeset 32275:b306120844bf

mail: remove code to support < Python 2.7 This code was added in 594b98846ce1. Since we no longer support Python <2.7, it can be removed.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 13 May 2017 11:12:44 -0700
parents 2b017d22fe97
children 1a3a08b5d4d5
files mercurial/mail.py
diffstat 1 files changed, 0 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/mail.py	Thu May 11 00:02:32 2017 -0700
+++ b/mercurial/mail.py	Sat May 13 11:12:44 2017 -0700
@@ -24,26 +24,6 @@
     util,
 )
 
-_oldheaderinit = email.header.Header.__init__
-def _unifiedheaderinit(self, *args, **kw):
-    """
-    Python 2.7 introduces a backwards incompatible change
-    (Python issue1974, r70772) in email.Generator.Generator code:
-    pre-2.7 code passed "continuation_ws='\t'" to the Header
-    constructor, and 2.7 removed this parameter.
-
-    Default argument is continuation_ws=' ', which means that the
-    behavior is different in <2.7 and 2.7
-
-    We consider the 2.7 behavior to be preferable, but need
-    to have an unified behavior for versions 2.4 to 2.7
-    """
-    # override continuation_ws
-    kw['continuation_ws'] = ' '
-    _oldheaderinit(self, *args, **kw)
-
-setattr(email.header.Header, '__init__', _unifiedheaderinit)
-
 class STARTTLS(smtplib.SMTP):
     '''Derived class to verify the peer certificate for STARTTLS.