File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ def process_diagnostic(diag):
14
14
else :
15
15
diag = False
16
16
def process_diagnostic (diag ):
17
- print ("\n " .join (diag .render (colored = True )))
17
+ print ("\n " .join (diag .render (colored = False )))
18
18
if diag .level in ("fatal" , "error" ):
19
19
exit (1 )
20
20
Original file line number Diff line number Diff line change @@ -22,9 +22,10 @@ def shorten_path(path):
22
22
lines = [shorten_path (path ) for path in diagnostic .render (colored = colored )]
23
23
return "\n " .join (lines )
24
24
25
+ colors_supported = (os .name == 'posix' )
25
26
class _DiagnosticEngine (diagnostic .Engine ):
26
27
def render_diagnostic (self , diagnostic ):
27
- sys .stderr .write (_render_diagnostic (diagnostic , colored = True ) + "\n " )
28
+ sys .stderr .write (_render_diagnostic (diagnostic , colored = colors_supported ) + "\n " )
28
29
29
30
class CompileError (Exception ):
30
31
def __init__ (self , diagnostic ):
@@ -33,7 +34,7 @@ def __init__(self, diagnostic):
33
34
def __str__ (self ):
34
35
# Prepend a newline so that the message shows up on after
35
36
# exception class name printed by Python.
36
- return "\n " + _render_diagnostic (self .diagnostic , colored = True )
37
+ return "\n " + _render_diagnostic (self .diagnostic , colored = colors_supported )
37
38
38
39
39
40
@syscall
You can’t perform that action at this time.
0 commit comments