From: Ben Darnell Date: Sat, 27 Mar 2010 17:30:46 +0000 (-0700) Subject: Don't try to colorize log output on terminals that don't support it X-Git-Tag: v1.0.0~65 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32a31f4e8ed2385a71b228d605c15ec47ce4d85d;p=thirdparty%2Ftornado.git Don't try to colorize log output on terminals that don't support it --- diff --git a/tornado/options.py b/tornado/options.py index a33ae4b66..781c2820d 100644 --- a/tornado/options.py +++ b/tornado/options.py @@ -311,7 +311,8 @@ def enable_pretty_logging(): if curses and sys.stderr.isatty(): try: curses.setupterm() - color = True + if curses.tigetnum("colors") > 0: + color = True except: pass channel = logging.StreamHandler()