Show More
@@ -408,22 +408,13 b' class chgcmdserver(commandserver.server)' | |||
|
408 | 408 | # be unbuffered no matter if it is a tty or not. |
|
409 | 409 | if fn == b'ferr': |
|
410 | 410 | newfp = fp |
|
411 |
el |
|
|
411 | else: | |
|
412 | 412 | # On Python 3, the standard library doesn't offer line-buffered |
|
413 | 413 | # binary streams, so wrap/unwrap it. |
|
414 | 414 | if fp.isatty(): |
|
415 | 415 | newfp = procutil.make_line_buffered(fp) |
|
416 | 416 | else: |
|
417 | 417 | newfp = procutil.unwrap_line_buffered(fp) |
|
418 | else: | |
|
419 | # Python 2 uses the I/O streams provided by the C library, so | |
|
420 | # make it line-buffered explicitly. Otherwise the default would | |
|
421 | # be decided on first write(), where fout could be a pager. | |
|
422 | if fp.isatty(): | |
|
423 | bufsize = 1 # line buffered | |
|
424 | else: | |
|
425 | bufsize = -1 # system default | |
|
426 | newfp = os.fdopen(fp.fileno(), mode, bufsize) | |
|
427 | 418 | if newfp is not fp: |
|
428 | 419 | setattr(ui, fn, newfp) |
|
429 | 420 | setattr(self, cn, newfp) |
General Comments 0
You need to be logged in to leave comments.
Login now