diff --git a/rscli/cli.py b/rscli/cli.py index efa9bcf..d3b5892 100644 --- a/rscli/cli.py +++ b/rscli/cli.py @@ -9,8 +9,11 @@ from rscli.httputils import req try: from colors import color + has_colors = True except ImportError: + has_colors = False +if not has_colors or not sys.stdout.isatty(): def color(text, *args, **kwargs): return text