boyska 4 роки тому
батько
коміт
19b42c21c7
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      rscli/cli.py

+ 3 - 0
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