Code

Ticket #6223: 6223.2.diff

File 6223.2.diff, 583 bytes (added by gwilson, 6 years ago)
Line 
1Index: django/core/management/color.py
2===================================================================
3--- django/core/management/color.py     (revision 7195)
4+++ django/core/management/color.py     (working copy)
5@@ -8,8 +8,7 @@
6 
7 def color_style():
8     """Returns a Style object with the Django color scheme."""
9-    if (sys.platform == 'win32' or sys.platform == 'Pocket PC'
10-        or sys.platform.startswith('java') or not sys.stdout.isatty()):
11+    if hasattr(sys.stdout, 'isatty') and sys.stdout.isatty():
12         return no_style()
13     class dummy: pass
14     style = dummy()