From a3cecbc1e36c56b1be58799458ff6b2b584b3e38 Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Fri, 22 May 2020 12:02:03 -0700 Subject: [PATCH] Check to see that text is not None before calling replace in write(). Error: 'NoneType' object has no attribute 'replace' --- codecov/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/codecov/__init__.py b/codecov/__init__.py index 42e38aa6..e04bbb1d 100644 --- a/codecov/__init__.py +++ b/codecov/__init__.py @@ -134,7 +134,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") @@ -161,7 +161,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):