From b7619a33c19bb739c9430710be67752718a4f358 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 25 Dec 2018 22:13:22 +0100 Subject: [PATCH] Don't print debug info for python 2.6 --- lib/spack/spack/compiler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index dd5cdfe8796..43f807cb14c 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -391,7 +391,12 @@ def make_compiler_list(tags, compiler_versions): in zip(tags, compiler_versions): # If we had an error, move to the next element if error: - tty.debug(error) + try: + # This will fail on Python 2.6 if a non ascii + # character is in the error + tty.debug(error) + except UnicodeEncodeError: + pass continue # Skip unknown versions