Mercurial > public > mercurial-scm > hg
comparison mercurial/utils/procutil.py @ 46784:65f437c240f2 stable
typing: disable a few errors when accessing Windows specific attributes
This is already guarded with conditionals. The entire win32 module is
conditionally loaded.
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 162, in <module>: No attribute 'winstdout' on module 'mercurial.posix' [module-attr]
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 163, in <module>: No attribute 'winstdout' on module 'mercurial.posix' [module-attr]
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 174, in <module>: No attribute 'winstdout' on module 'mercurial.posix' [module-attr]
File "/mnt/c/Users/Matt/hg/mercurial/utils/procutil.py", line 175, in <module>: No attribute 'winstdout' on module 'mercurial.posix' [module-attr]
Differential Revision: https://phab.mercurial-scm.org/D10206
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 12 Mar 2021 17:22:35 -0500 |
parents | 128a17d8436f |
children | d4ba4d51f85f |
comparison
equal
deleted
inserted
replaced
46783:7fd369644c68 | 46784:65f437c240f2 |
---|---|
150 else: | 150 else: |
151 stderr = _make_write_all(sys.stderr.buffer) | 151 stderr = _make_write_all(sys.stderr.buffer) |
152 | 152 |
153 if pycompat.iswindows: | 153 if pycompat.iswindows: |
154 # Work around Windows bugs. | 154 # Work around Windows bugs. |
155 stdout = platform.winstdout(stdout) | 155 stdout = platform.winstdout(stdout) # pytype: disable=module-attr |
156 stderr = platform.winstdout(stderr) | 156 stderr = platform.winstdout(stderr) # pytype: disable=module-attr |
157 if isatty(stdout): | 157 if isatty(stdout): |
158 # The standard library doesn't offer line-buffered binary streams. | 158 # The standard library doesn't offer line-buffered binary streams. |
159 stdout = make_line_buffered(stdout) | 159 stdout = make_line_buffered(stdout) |
160 else: | 160 else: |
161 # Python 2 uses the I/O streams provided by the C library. | 161 # Python 2 uses the I/O streams provided by the C library. |
162 stdin = sys.stdin | 162 stdin = sys.stdin |
163 stdout = sys.stdout | 163 stdout = sys.stdout |
164 stderr = sys.stderr | 164 stderr = sys.stderr |
165 if pycompat.iswindows: | 165 if pycompat.iswindows: |
166 # Work around Windows bugs. | 166 # Work around Windows bugs. |
167 stdout = platform.winstdout(stdout) | 167 stdout = platform.winstdout(stdout) # pytype: disable=module-attr |
168 stderr = platform.winstdout(stderr) | 168 stderr = platform.winstdout(stderr) # pytype: disable=module-attr |
169 if isatty(stdout): | 169 if isatty(stdout): |
170 if pycompat.iswindows: | 170 if pycompat.iswindows: |
171 # The Windows C runtime library doesn't support line buffering. | 171 # The Windows C runtime library doesn't support line buffering. |
172 stdout = make_line_buffered(stdout) | 172 stdout = make_line_buffered(stdout) |
173 else: | 173 else: |