Skip to content

Commit 4586a6a

Browse files
committed
validation: make test_shell Python3 friendly
The custom `shell` module would coerce the byte-string representation from `subprocess` into a text string representation in the happy path. However, the same handling was not applied to the error case. This would result in a byte-string representation being returned in Python 3 rather than the text string. Perform the conversion in both cases to ensure that we can handle the strings without having to do the conversion.
1 parent 108094d commit 4586a6a

File tree

1 file changed

+1
-1
lines changed
  • utils/swift_build_support/swift_build_support

1 file changed

+1
-1
lines changed

utils/swift_build_support/swift_build_support/shell.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def capture(command, stderr=None, env=None, dry_run=None, echo=True,
137137
return str(out.decode())
138138
except subprocess.CalledProcessError as e:
139139
if allow_non_zero_exit:
140-
return e.output
140+
return str(e.output.decode())
141141
if optional:
142142
return None
143143
_fatal_error(

0 commit comments

Comments
 (0)