ThreadPool doesn't implement the context manager protocol in Python 2

This commit is contained in:
Massimiliano Culpo 2018-12-24 21:49:49 +01:00
parent d89aa69f96
commit f8bbfe683c
No known key found for this signature in database
GPG Key ID: D1ADB1014FF1118C

View File

@ -195,8 +195,9 @@ def find_compilers(*paths):
t, c = o.search_compiler_commands(*paths) t, c = o.search_compiler_commands(*paths)
tags.extend(t), commands.extend(c) tags.extend(t), commands.extend(c)
with multiprocessing.pool.ThreadPool() as tp: tp = multiprocessing.pool.ThreadPool()
compiler_versions = llnl.util.multiproc.execute(commands, tp.map) compiler_versions = llnl.util.multiproc.execute(commands, tp.map)
tp.close()
return spack.compiler.make_compiler_list(tags, compiler_versions) return spack.compiler.make_compiler_list(tags, compiler_versions)