Ticket #6223: 6223.3.diff

File 6223.3.diff, 612 bytes (added by Gary Wilson, 17 years ago)
  • django/core/management/color.py

     
    88
    99def color_style():
    1010    """Returns a Style object with the Django color scheme."""
    11     if (sys.platform == 'win32' or sys.platform == 'Pocket PC'
    12         or sys.platform.startswith('java') or not sys.stdout.isatty()):
     11    is_a_tty = hasattr(sys.stdout, 'isatty') and sys.stdout.isatty()
     12    if not is_a_tty:
    1313        return no_style()
    1414    class dummy: pass
    1515    style = dummy()
Back to Top