Mercurial > public > mercurial-scm > hg
comparison mercurial/mail.py @ 43498:3b31ee5388f3
mail: suppress a pytype error that's just experimentally wrong
It's probably more correct to pass a str here, but I'm not going to
worry about it for now.
Differential Revision: https://phab.mercurial-scm.org/D7283
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 06 Nov 2019 15:34:40 -0500 |
parents | fdc3af52305b |
children | 9f70512ae2cf |
comparison
equal
deleted
inserted
replaced
43497:6d001f452bcb | 43498:3b31ee5388f3 |
---|---|
277 | 277 |
278 def mimetextqp(body, subtype, charset): | 278 def mimetextqp(body, subtype, charset): |
279 '''Return MIME message. | 279 '''Return MIME message. |
280 Quoted-printable transfer encoding will be used if necessary. | 280 Quoted-printable transfer encoding will be used if necessary. |
281 ''' | 281 ''' |
282 cs = email.charset.Charset(charset) | 282 # Experimentally charset is okay as a bytes even if the type |
283 # stubs disagree. | |
284 cs = email.charset.Charset(charset) # pytype: disable=wrong-arg-types | |
283 msg = email.message.Message() | 285 msg = email.message.Message() |
284 msg.set_type(pycompat.sysstr(b'text/' + subtype)) | 286 msg.set_type(pycompat.sysstr(b'text/' + subtype)) |
285 | 287 |
286 for line in body.splitlines(): | 288 for line in body.splitlines(): |
287 if len(line) > 950: | 289 if len(line) > 950: |