File tree 1 file changed +9
-4
lines changed 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,15 @@ def main():
66
66
log = export_log (xcresult_path , log_id )
67
67
68
68
# Avoid a potential UnicodeEncodeError raised by sys.stdout.write() by
69
- # doing a relaxed encoding ourselves and writing the resulting bytes.
70
- log_encoded = log .encode ('utf8' , errors = 'backslashreplace' )
71
- sys .stdout .flush ()
72
- sys .stdout .buffer .write (log_encoded )
69
+ # doing a relaxed encoding ourselves.
70
+ if hasattr (sys .stdout , 'buffer' ):
71
+ log_encoded = log .encode ('utf8' , errors = 'backslashreplace' )
72
+ sys .stdout .flush ()
73
+ sys .stdout .buffer .write (log_encoded )
74
+ else :
75
+ log_encoded = log .encode ('ascii' , errors = 'backslashreplace' )
76
+ log_decoded = log_encoded .decode ('ascii' , errors = 'strict' )
77
+ sys .stdout .write (log_decoded )
73
78
74
79
75
80
# Most flags on the xcodebuild command-line are uninteresting, so only pull
You can’t perform that action at this time.
0 commit comments