From 6d56d4545472ddff1cdc0e8fd49d8260428a141e Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Fri, 7 Jun 2019 18:57:26 +0200 Subject: Compiler search uses a pool of workers (#10190) - spack.compilers.find_compilers now uses a multiprocess.pool.ThreadPool to execute system commands for the detection of compiler versions. - A few memoized functions have been introduced to avoid poking the filesystem multiple times for the same results. - Performance is much improved, and Spack no longer fork-bombs the system when doing a `compiler find` --- lib/spack/llnl/util/tty/color.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/spack/llnl/util/tty/color.py') diff --git a/lib/spack/llnl/util/tty/color.py b/lib/spack/llnl/util/tty/color.py index fd982b54af..6789ecbdb3 100644 --- a/lib/spack/llnl/util/tty/color.py +++ b/lib/spack/llnl/util/tty/color.py @@ -59,10 +59,14 @@ The console can be reset later to plain text with '@.'. To output an @, use '@@'. To output a } inside braces, use '}}'. """ +from __future__ import unicode_literals import re import sys + from contextlib import contextmanager +import six + class ColorParseError(Exception): """Raised when a color format fails to parse.""" @@ -244,7 +248,7 @@ def cescape(string): Returns: (str): the string with color codes escaped """ - string = str(string) + string = six.text_type(string) string = string.replace('@', '@@') string = string.replace('}', '}}') return string -- cgit v1.2.3-60-g2f50