Show More
@@ -49,23 +49,22 b' def isatty(fp):' | |||
|
49 | 49 | return False |
|
50 | 50 | |
|
51 | 51 | |
|
52 | if pycompat.ispy3: | |
|
52 | class LineBufferedWrapper(object): | |
|
53 | def __init__(self, orig): | |
|
54 | self.orig = orig | |
|
53 | 55 | |
|
54 | class LineBufferedWrapper(object): | |
|
55 | def __init__(self, orig): | |
|
56 | self.orig = orig | |
|
57 | ||
|
58 | def __getattr__(self, attr): | |
|
59 | return getattr(self.orig, attr) | |
|
56 | def __getattr__(self, attr): | |
|
57 | return getattr(self.orig, attr) | |
|
60 | 58 | |
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
|
65 |
|
|
|
66 |
|
|
|
59 | def write(self, s): | |
|
60 | orig = self.orig | |
|
61 | res = orig.write(s) | |
|
62 | if s.endswith(b'\n'): | |
|
63 | orig.flush() | |
|
64 | return res | |
|
67 | 65 | |
|
68 | io.BufferedIOBase.register(LineBufferedWrapper) | |
|
66 | ||
|
67 | io.BufferedIOBase.register(LineBufferedWrapper) | |
|
69 | 68 | |
|
70 | 69 | |
|
71 | 70 | # glibc determines buffering on first write to stdout - if we replace a TTY |
General Comments 0
You need to be logged in to leave comments.
Login now