diff -r ad1ce3c7af72 -r bac14dbbbfab mercurial/mail.py --- a/mercurial/mail.py Wed May 11 14:18:52 2016 -0700 +++ b/mercurial/mail.py Tue May 17 05:32:36 2016 +0530 @@ -41,7 +41,7 @@ kw['continuation_ws'] = ' ' _oldheaderinit(self, *args, **kw) -email.Header.Header.__dict__['__init__'] = _unifiedheaderinit +setattr(email.header.Header, '__init__', _unifiedheaderinit) class STARTTLS(smtplib.SMTP): '''Derived class to verify the peer certificate for STARTTLS.