Fix color printing

This commit is contained in:
topjohnwu 2023-05-16 02:07:49 -07:00
parent 2d799dae0d
commit 2ea1a47bec
1 changed files with 2 additions and 2 deletions

View File

@ -18,9 +18,9 @@ from zipfile import ZipFile
def color_print(code, str):
if no_color:
print(f"\n{str}\n")
print(str)
else:
str.replace("\n", "\033[K\n")
str = str.replace("\n", f"\033[0m\n{code}")
print(f"{code}{str}\033[0m")