py3: use setattr() to assign new class attribute
The old method produces error 'object does not supports item assignment'.
So setattr() is used to assign a new class attribute via __dict__ .
--- 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.