equal
deleted
inserted
replaced
185 kwargs["write_through"] = sys.stderr.write_through |
185 kwargs["write_through"] = sys.stderr.write_through |
186 sys.stderr = io.TextIOWrapper( |
186 sys.stderr = io.TextIOWrapper( |
187 sys.stderr.buffer, sys.stderr.encoding, sys.stderr.errors, **kwargs |
187 sys.stderr.buffer, sys.stderr.encoding, sys.stderr.errors, **kwargs |
188 ) |
188 ) |
189 |
189 |
190 # No write_through on read-only stream. |
190 if sys.stdin is not None: |
191 sys.stdin = io.TextIOWrapper( |
191 # No write_through on read-only stream. |
192 sys.stdin.buffer, |
192 sys.stdin = io.TextIOWrapper( |
193 sys.stdin.encoding, |
193 sys.stdin.buffer, |
194 sys.stdin.errors, |
194 sys.stdin.encoding, |
195 # None is universal newlines mode. |
195 sys.stdin.errors, |
196 newline=None, |
196 # None is universal newlines mode. |
197 line_buffering=sys.stdin.line_buffering, |
197 newline=None, |
198 ) |
198 line_buffering=sys.stdin.line_buffering, |
|
199 ) |
199 |
200 |
200 def _silencestdio(): |
201 def _silencestdio(): |
201 for fp in (sys.stdout, sys.stderr): |
202 for fp in (sys.stdout, sys.stderr): |
202 # Check if the file is okay |
203 # Check if the file is okay |
203 try: |
204 try: |