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 17
17
import abc
18
18
import dataclasses
19
19
import os
20
+ import shlex
20
21
import signal
21
22
import subprocess
22
23
import tempfile
@@ -182,7 +183,7 @@ def start_cancellable_process(
182
183
if _QUIET .value :
183
184
command_env ['TF_CPP_MIN_LOG_LEVEL' ] = '1'
184
185
else :
185
- logging .info (cmdline )
186
+ logging .info (shlex . join ( cmdline ) )
186
187
with subprocess .Popen (
187
188
cmdline ,
188
189
env = command_env ,
@@ -193,15 +194,18 @@ def start_cancellable_process(
193
194
try :
194
195
retcode = p .wait (timeout = timeout )
195
196
except subprocess .TimeoutExpired as e :
197
+ logging .info ('Command hit timeout: %s' , shlex .join (cmdline ))
196
198
kill_process_ignore_exceptions (p )
197
199
raise e
198
200
finally :
199
201
if cancellation_manager :
200
202
cancellation_manager .unregister_process (p )
201
203
202
204
if retcode != 0 :
203
- raise ProcessKilledError (
204
- ) if retcode == - 9 else subprocess .CalledProcessError (retcode , cmdline )
205
+ if retcode == - 9 :
206
+ raise ProcessKilledError ()
207
+ logging .info ('Command returned code %d: %s' , retcode , shlex .join (cmdline ))
208
+ raise subprocess .CalledProcessError (retcode , cmdline )
205
209
else :
206
210
if want_output :
207
211
ret : bytes = p .stdout .read ()
You can’t perform that action at this time.
0 commit comments