diff options
author | Betsy McPhail <betsy.mcphail@kitware.com> | 2022-08-26 19:37:56 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-26 17:37:56 -0600 |
commit | ad95719a1d7efae31d625967de1f135037a4b84d (patch) | |
tree | 2f88f2a41391aab33994a66c86bbc98e87efb30e /lib | |
parent | 59bfa6bcd336887364ac9fcf2b903f6b276edb9e (diff) | |
download | spack-ad95719a1d7efae31d625967de1f135037a4b84d.tar.gz spack-ad95719a1d7efae31d625967de1f135037a4b84d.tar.bz2 spack-ad95719a1d7efae31d625967de1f135037a4b84d.tar.xz spack-ad95719a1d7efae31d625967de1f135037a4b84d.zip |
Use threading.TIMEOUT_MAX when available (#32399)
This value was introduced in Python 3.2. Specifying a timeout greater than
this value will raise an OverflowError.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/external/ctest_log_parser.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/spack/external/ctest_log_parser.py b/lib/spack/external/ctest_log_parser.py index 2b2746003a..d1c8db16c8 100644 --- a/lib/spack/external/ctest_log_parser.py +++ b/lib/spack/external/ctest_log_parser.py @@ -71,6 +71,8 @@ from __future__ import division import re import math import multiprocessing +import sys +import threading import time from contextlib import contextmanager @@ -409,7 +411,12 @@ class CTestLogParser(object): pool = multiprocessing.Pool(jobs) try: # this is a workaround for a Python bug in Pool with ctrl-C - results = pool.map_async(_parse_unpack, args, 1).get(9999999) + if sys.version_info >= (3, 2): + max_timeout = threading.TIMEOUT_MAX + else: + max_timeout = 9999999 + results = pool.map_async(_parse_unpack, args, 1).get(max_timeout) + errors, warnings, timings = zip(*results) finally: pool.terminate() |