equal
deleted
inserted
replaced
40 except AttributeError: |
40 except AttributeError: |
41 return False |
41 return False |
42 |
42 |
43 # glibc determines buffering on first write to stdout - if we replace a TTY |
43 # glibc determines buffering on first write to stdout - if we replace a TTY |
44 # destined stdout with a pipe destined stdout (e.g. pager), we want line |
44 # destined stdout with a pipe destined stdout (e.g. pager), we want line |
45 # buffering |
45 # buffering (or unbuffered, on Windows) |
46 if isatty(stdout): |
46 if isatty(stdout): |
47 stdout = os.fdopen(stdout.fileno(), r'wb', 1) |
47 if pycompat.iswindows: |
|
48 # Windows doesn't support line buffering |
|
49 stdout = os.fdopen(stdout.fileno(), r'wb', 0) |
|
50 else: |
|
51 stdout = os.fdopen(stdout.fileno(), r'wb', 1) |
48 |
52 |
49 if pycompat.iswindows: |
53 if pycompat.iswindows: |
50 from .. import windows as platform |
54 from .. import windows as platform |
51 stdout = platform.winstdout(stdout) |
55 stdout = platform.winstdout(stdout) |
52 else: |
56 else: |