Mercurial > p > roundup > code
changeset 5421:45bfb4bf59c2
Python 3 preparation: remove obsolete email module monkey patch.
This monkey patch has a comment saying it's obsolete with a minimum
Python version of 2.7. Furthermore, it does not work with Python 3,
both because the email.Header name has gone away (only email.header
remains) and because the __dict__ object is a mappingproxy in Python 3
which can't be modified in the way used there. So the monkey patch is
removed in this patch.
| author | Joseph Myers <jsm@polyomino.org.uk> |
|---|---|
| date | Wed, 25 Jul 2018 09:27:46 +0000 |
| parents | 7172c201dec2 |
| children | a0ed8d5d744f |
| files | roundup/anypy/email_.py |
| diffstat | 1 files changed, 0 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/roundup/anypy/email_.py Wed Jul 25 09:10:46 2018 +0000 +++ b/roundup/anypy/email_.py Wed Jul 25 09:27:46 2018 +0000 @@ -4,18 +4,6 @@ from email import quoprimime, base64mime ## please import this file if you are using the email module -# -# a "monkey patch" to unify the behaviour of python 2.5 2.6 2.7 -# when generating header files, see http://bugs.python.org/issue1974 -# and https://hg.python.org/cpython/rev/5deb27042e5a/ -# can go away once the minimum requirement is python 2.7 -_oldheaderinit = email.Header.Header.__init__ -def _unifiedheaderinit(self, *args, **kw): - # override continuation_ws - kw['continuation_ws'] = ' ' - _oldheaderinit(self, *args, **kw) -email.Header.Header.__dict__['__init__'] = _unifiedheaderinit -## # Match encoded-word strings in the form =?charset?q?Hello_World?= ecre = re.compile(r'''
