Skip to content

Commit 53becf4

Browse files
authored
Check to see that text is not None before calling replace in write(). (codecov#262)
Error: 'NoneType' object has no attribute 'replace'
1 parent fd64abc commit 53becf4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

codecov/__init__.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ def sanitize_arg(replacement, arg):
147147

148148
def write(text, color=None):
149149
global COLOR
150-
if COLOR:
150+
if text and COLOR:
151151
text = text.replace("==>", "\033[90m==>\033[0m")
152152
text = text.replace(" +", " \033[32m+\033[0m")
153153
text = text.replace("XX>", "\033[31mXX>\033[0m")
@@ -174,7 +174,8 @@ def write(text, color=None):
174174
elif color == "green":
175175
text = "\033[92m%s\033[0m" % text
176176

177-
sys.stdout.write(text + "\n")
177+
if text:
178+
sys.stdout.write(text + "\n")
178179

179180

180181
def fopen(path):

0 commit comments

Comments
 (0)