fix bug in ColorStream
This commit is contained in:
parent
94b4a0f317
commit
af3a165a20
@ -326,8 +326,7 @@ def __init__(self, stream, color=None):
|
||||
self._stream = stream
|
||||
self._color = color
|
||||
|
||||
def write(self, string, **kwargs):
|
||||
raw = kwargs.get("raw", False)
|
||||
def write(self, string, raw=False):
|
||||
raw_write = getattr(self._stream, "write")
|
||||
|
||||
color = self._color
|
||||
@ -338,7 +337,6 @@ def write(self, string, **kwargs):
|
||||
color = get_color_when()
|
||||
raw_write(colorize(string, color=color))
|
||||
|
||||
def writelines(self, sequence, **kwargs):
|
||||
raw = kwargs.get("raw", False)
|
||||
def writelines(self, sequence, raw=False):
|
||||
for string in sequence:
|
||||
self.write(string, self.color, raw=raw)
|
||||
self.write(string, raw=raw)
|
||||
|
Loading…
Reference in New Issue
Block a user