Closed elbert5770 closed 2 years ago
FWIW, PETsc has updated their version of the script file to use is_alive().
def runInShell(commandseq, log, cwd, env):
if useThreads and threads:
import threading
log.write('Running Executable with threads to time it out at '+str(timeout)+'\n')
class InShell(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.name = 'Shell Command'
self.setDaemon(1)
def run(self):
(self.output, self.error, self.status) = ('', '', -1) # So these fields exist even if command fails with no output
(self.output, self.error, self.status) = Script.runShellCommandSeq(commandseq, log, cwd, env)
thread = InShell()
thread.start()
thread.join(timeout)
if thread.is_alive():
error = 'Runaway process exceeded time limit of '+str(timeout)+'\n'
log.write(error)
return ('', error, -1)
else:
return (thread.output, thread.error, thread.status)
else:
return Script.runShellCommandSeq(commandseq, log, cwd, env)
(output, error, status) = runInShell(commandseq, log, cwd, env)
output = logOutput(log, output,logOutputflg)
checkCommand(commandseq, status, output, error)
return (output, error, status)
Thanks for reporting this - I will patch this and a few other things in a week or so when we finalize the next ibamr release.
Error below with Python 3.10.4
Forum post that isAlive() removed in Python 3.9 https://github.com/fkie/multimaster_fkie/issues/149
Location in code that uses isAlive() /home/elbert5770/autoibamr/tmp/unpack/petsc-3.13.1/config/BuildSystem/script.py