]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Don't try to colorize log output on terminals that don't support it
authorBen Darnell <bdarnell@beaker.local>
Sat, 27 Mar 2010 17:30:46 +0000 (10:30 -0700)
committerBen Darnell <bdarnell@beaker.local>
Sat, 27 Mar 2010 17:30:46 +0000 (10:30 -0700)
tornado/options.py

index a33ae4b669eb9c6c5786aefe2bd2ded50b6bdf8e..781c2820d498aaa7cfa974afd11b54db69042de4 100644 (file)
@@ -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()