Mercurial > public > mercurial-scm > hg-stable
diff mercurial/dispatch.py @ 46414:52528570312e stable
typing: disable module attribute warnings for properly conditionalized code
Differential Revision: https://phab.mercurial-scm.org/D10208
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Sat, 13 Mar 2021 00:40:46 -0500 |
parents | 9c9e0b4b2ca7 |
children | d4ba4d51f85f |
line wrap: on
line diff
--- a/mercurial/dispatch.py Sat Mar 13 00:38:59 2021 -0500 +++ b/mercurial/dispatch.py Sat Mar 13 00:40:46 2021 -0500 @@ -173,7 +173,9 @@ "line_buffering": sys.stdout.line_buffering, } if util.safehasattr(sys.stdout, "write_through"): + # pytype: disable=attribute-error kwargs["write_through"] = sys.stdout.write_through + # pytype: enable=attribute-error sys.stdout = io.TextIOWrapper( sys.stdout.buffer, sys.stdout.encoding, @@ -187,7 +189,9 @@ "line_buffering": sys.stderr.line_buffering, } if util.safehasattr(sys.stderr, "write_through"): + # pytype: disable=attribute-error kwargs["write_through"] = sys.stderr.write_through + # pytype: enable=attribute-error sys.stderr = io.TextIOWrapper( sys.stderr.buffer, sys.stderr.encoding,