Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/patch.py @ 48522:290f9c150f70
pytype: stop excluding patch.py
The underlying `email.generator.BytesGenerator` is documented as requiring an
`fp` that accepts bytes, so I'm not sure why pytype is getting confused:
File "/mnt/c/Users/Matt/hg/mercurial/patch.py", line 112, in msgfp:
Function Generator.__init__ was called with the wrong arguments [wrong-arg-types]
Expected: (self, outfp: TextIO, ...)
Actually passed: (self, outfp: io.BytesIO, ...)
Differential Revision: https://phab.mercurial-scm.org/D11922
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 13 Dec 2021 20:19:09 -0500 |
parents | 6a454e7053a1 |
children | 6000f5b25c9b |
comparison
equal
deleted
inserted
replaced
48521:d2fff292c265 | 48522:290f9c150f70 |
---|---|
107 yield c | 107 yield c |
108 | 108 |
109 def mimesplit(stream, cur): | 109 def mimesplit(stream, cur): |
110 def msgfp(m): | 110 def msgfp(m): |
111 fp = stringio() | 111 fp = stringio() |
112 # pytype: disable=wrong-arg-types | |
112 g = mail.Generator(fp, mangle_from_=False) | 113 g = mail.Generator(fp, mangle_from_=False) |
114 # pytype: enable=wrong-arg-types | |
113 g.flatten(m) | 115 g.flatten(m) |
114 fp.seek(0) | 116 fp.seek(0) |
115 return fp | 117 return fp |
116 | 118 |
117 for line in stream: | 119 for line in stream: |