Skip to content

Commit 13d2318

Browse files
authored
Merge pull request #40 from jnsnow/output-prefer-stderr
out.py: prefer stderr and remove isatty() restriction
2 parents 143146f + 79ac893 commit 13d2318

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

stgit/out.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ def __init__(self, file=None):
9999
sys.stderr.fileno(), 'w', buffering=1, encoding='utf-8'
100100
)
101101
)
102-
if file or sys.stdout.isatty():
103-
self.__out = self.__stdout
104-
else:
105-
self.__out = Output(None)
102+
self.__out = self.__stdout
106103

107104
def stdout(self, line):
108105
"""Write a line to stdout."""
@@ -127,10 +124,10 @@ def err_bytes(self, byte_data):
127124

128125
def info(self, *msgs):
129126
for msg in msgs:
130-
self.__out.single_line(msg)
127+
self.__stderr.single_line(msg)
131128

132129
def note(self, *msgs, **kw):
133-
self.__out.tagged_lines(kw.get('title', 'Notice'), msgs)
130+
self.__stderr.tagged_lines(kw.get('title', 'Notice'), msgs)
134131

135132
def warn(self, *msgs, **kw):
136133
self.__stderr.tagged_lines(kw.get('title', 'Warning'), msgs)

0 commit comments

Comments
 (0)