fix bug in ColorStream

This commit is contained in:
Todd Gamblin 2023-02-23 00:28:36 -08:00
parent 94b4a0f317
commit af3a165a20
No known key found for this signature in database
GPG Key ID: C16729F1AACF66C6

View File

@ -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)