Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Check to see that text is not None before calling replace in write(). (
Browse files Browse the repository at this point in the history
…#262)

Error: 'NoneType' object has no attribute 'replace'
  • Loading branch information
nmoinvaz committed May 27, 2020
1 parent fd64abc commit 53becf4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions codecov/__init__.py
Expand Up @@ -147,7 +147,7 @@ def sanitize_arg(replacement, arg):

def write(text, color=None):
global COLOR
if COLOR:
if text and COLOR:
text = text.replace("==>", "\033[90m==>\033[0m")
text = text.replace(" +", " \033[32m+\033[0m")
text = text.replace("XX>", "\033[31mXX>\033[0m")
Expand All @@ -174,7 +174,8 @@ def write(text, color=None):
elif color == "green":
text = "\033[92m%s\033[0m" % text

sys.stdout.write(text + "\n")
if text:
sys.stdout.write(text + "\n")


def fopen(path):
Expand Down

0 comments on commit 53becf4

Please sign in to comment.