File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -97,8 +97,12 @@ def build_extension(self, ext):
97
97
try :
98
98
output = subprocess .check_output (args , env = env )
99
99
except subprocess .CalledProcessError as e :
100
+ output = e .output
101
+ if isinstance (output , bytes ):
102
+ output = e .output .decode ('latin-1' ).strip ()
100
103
raise CompileError (
101
- "cargo failed with code: %d\n %s" % (e .returncode , e .output ))
104
+ "cargo failed with code: %d\n %s" % (e .returncode , output ))
105
+
102
106
except OSError :
103
107
raise DistutilsExecError (
104
108
"Unable to execute 'cargo' - this package "
@@ -107,8 +111,8 @@ def build_extension(self, ext):
107
111
if not quiet :
108
112
if isinstance (output , bytes ):
109
113
output = output .decode ('latin-1' )
110
- if output :
111
- print (output , file = sys .stderr )
114
+ if output :
115
+ print (output , file = sys .stderr )
112
116
113
117
# Find the shared library that cargo hopefully produced and copy
114
118
# it into the build directory as if it were produced by build_ext.
You can’t perform that action at this time.
0 commit comments