Skip to content

Commit 4028410

Browse files
committed
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.
1 parent 9bd09e4 commit 4028410

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

roundup/anypy/email_.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,6 @@
44
from email import quoprimime, base64mime
55

66
## please import this file if you are using the email module
7-
#
8-
# a "monkey patch" to unify the behaviour of python 2.5 2.6 2.7
9-
# when generating header files, see http://bugs.python.org/issue1974
10-
# and https://hg.python.org/cpython/rev/5deb27042e5a/
11-
# can go away once the minimum requirement is python 2.7
12-
_oldheaderinit = email.Header.Header.__init__
13-
def _unifiedheaderinit(self, *args, **kw):
14-
# override continuation_ws
15-
kw['continuation_ws'] = ' '
16-
_oldheaderinit(self, *args, **kw)
17-
email.Header.Header.__dict__['__init__'] = _unifiedheaderinit
18-
##
197

208
# Match encoded-word strings in the form =?charset?q?Hello_World?=
219
ecre = re.compile(r'''

0 commit comments

Comments
 (0)