Commit 8efe95c4 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

Do not print colors if stdout is not tty

Refs #3520
parent 8c2716c5
......@@ -43,9 +43,18 @@ from devflow import versioning
from devflow import utils
from devflow import BRANCH_TYPES
try:
from colors import red, green
except ImportError:
if sys.stdout.isatty():
try:
import colors
use_colors = True
except AttributeError:
use_colors = False
if use_colors:
red = colors.red
green = colors.green
else:
red = lambda x: x
green = lambda x: x
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment