Python 版本:2.6.7 我在执行 18 次的 for 循环中有以下 subprocess.call,但是,该进程在第 19 次循环中不断挂起:
if config.get_bool_option(NAME, 'exclude_generated_code', True):
for conf in desc.iter_configs():
for gen in desc.iter_generators(conf):
generator.initialize_generated_path(gen, desc)
for genpath in gen.generated_path:
os.rename(cov_file, cov_file+'.temp')
exclude = ['lcov']
exclude += ['-r', cov_file+'.temp', '"'+genpath+'/*"']
exclude += ['-o', cov_file]
if verbose: Tracer.log.info("Running "+ ' '.join(exclude))
try:
subprocess.call(' '.join(exclude), stdout=out, stderr=out, shell=True)
except subprocess.CalledProcessError, e:
if verbose: Tracer.log.info("TESTING: Got Exception \n")
控制台输出如下所示:
Running lcov -r /remote/XXXXXX/coverage.19.temp "/remote/XXXXXX/xml/2009a/generated/*" -o /remote/XXXXX/gcov/coverage.19
由于我对python脚本不是很熟悉,所以我只是在这里徘徊我是否做错了什么......我怀疑某个地方出现了死锁......
会stdout, stderr = process.communicate()
处理这些问题吗?
请问在什么情况下 subprocess.call 会挂起的任何专家答案?非常感谢