##// END OF EJS Templates
typing: disable module attribute warnings for properly conditionalized code...
Matt Harbison -
r47544:52528570 stable
parent child Browse files
Show More
@@ -173,7 +173,9 b' if pycompat.ispy3:'
173 173 "line_buffering": sys.stdout.line_buffering,
174 174 }
175 175 if util.safehasattr(sys.stdout, "write_through"):
176 # pytype: disable=attribute-error
176 177 kwargs["write_through"] = sys.stdout.write_through
178 # pytype: enable=attribute-error
177 179 sys.stdout = io.TextIOWrapper(
178 180 sys.stdout.buffer,
179 181 sys.stdout.encoding,
@@ -187,7 +189,9 b' if pycompat.ispy3:'
187 189 "line_buffering": sys.stderr.line_buffering,
188 190 }
189 191 if util.safehasattr(sys.stderr, "write_through"):
192 # pytype: disable=attribute-error
190 193 kwargs["write_through"] = sys.stderr.write_through
194 # pytype: enable=attribute-error
191 195 sys.stderr = io.TextIOWrapper(
192 196 sys.stderr.buffer,
193 197 sys.stderr.encoding,
@@ -172,7 +172,7 b' if not pycompat.iswindows:'
172 172 else:
173 173 import msvcrt
174 174
175 _kernel32 = ctypes.windll.kernel32
175 _kernel32 = ctypes.windll.kernel32 # pytype: disable=module-attr
176 176
177 177 _DWORD = ctypes.c_ulong
178 178 _LPCSTR = _LPSTR = ctypes.c_char_p
@@ -216,7 +216,7 b' else:'
216 216 _kernel32.CreateFileA.restype = _HANDLE
217 217
218 218 def _raiseioerror(name):
219 err = ctypes.WinError()
219 err = ctypes.WinError() # pytype: disable=module-attr
220 220 raise IOError(
221 221 err.errno, '%s: %s' % (encoding.strfromlocal(name), err.strerror)
222 222 )
@@ -271,7 +271,7 b' else:'
271 271 if fh == _INVALID_HANDLE_VALUE:
272 272 _raiseioerror(name)
273 273
274 fd = msvcrt.open_osfhandle(fh, flags)
274 fd = msvcrt.open_osfhandle(fh, flags) # pytype: disable=module-attr
275 275 if fd == -1:
276 276 _kernel32.CloseHandle(fh)
277 277 _raiseioerror(name)
@@ -543,7 +543,9 b' def wrapserversocket('
543 543 # Use the list of more secure ciphers if found in the ssl module.
544 544 if util.safehasattr(ssl, b'_RESTRICTED_SERVER_CIPHERS'):
545 545 sslcontext.options |= getattr(ssl, 'OP_CIPHER_SERVER_PREFERENCE', 0)
546 # pytype: disable=module-attr
546 547 sslcontext.set_ciphers(ssl._RESTRICTED_SERVER_CIPHERS)
548 # pytype: enable=module-attr
547 549
548 550 if requireclientcert:
549 551 sslcontext.verify_mode = ssl.CERT_REQUIRED
General Comments 0
You need to be logged in to leave comments. Login now