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