From ad95719a1d7efae31d625967de1f135037a4b84d Mon Sep 17 00:00:00 2001 From: Betsy McPhail Date: Fri, 26 Aug 2022 19:37:56 -0400 Subject: 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. --- lib/spack/external/ctest_log_parser.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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() -- cgit v1.2.3-60-g2f50