diff -r a83c9c79b722 -r 0e6a7ce81dde mercurial/patch.py --- a/mercurial/patch.py Thu Oct 10 10:03:01 2019 +0200 +++ b/mercurial/patch.py Thu Oct 10 10:48:57 2019 +0200 @@ -11,7 +11,6 @@ import collections import contextlib import copy -import email import errno import hashlib import os @@ -107,7 +106,7 @@ def mimesplit(stream, cur): def msgfp(m): fp = stringio() - g = email.Generator.Generator(fp, mangle_from_=False) + g = mail.Generator(fp, mangle_from_=False) g.flatten(m) fp.seek(0) return fp