Commit a1ed75e4 authored by Mark Florisson's avatar Mark Florisson Committed by Vitja Makarov

Use locale's encoding to decode output in test runner

parent 55ddc084
...@@ -4,6 +4,7 @@ import os ...@@ -4,6 +4,7 @@ import os
import sys import sys
import re import re
import gc import gc
import locale
import codecs import codecs
import shutil import shutil
import time import time
...@@ -130,7 +131,7 @@ def get_openmp_compiler_flags(language): ...@@ -130,7 +131,7 @@ def get_openmp_compiler_flags(language):
try: try:
p = subprocess.Popen([cc, "-v"], stdout=subprocess.PIPE, p = subprocess.Popen([cc, "-v"], stdout=subprocess.PIPE,
stderr=subprocess.STDOUT) stderr=subprocess.STDOUT)
except EnvironmentError, e: except EnvironmentError:
# Be compatible with Python 3 # Be compatible with Python 3
_, e, _ = sys.exc_info() _, e, _ = sys.exc_info()
warnings.warn("Unable to find the %s compiler: %s: %s" % warnings.warn("Unable to find the %s compiler: %s: %s" %
...@@ -139,11 +140,15 @@ def get_openmp_compiler_flags(language): ...@@ -139,11 +140,15 @@ def get_openmp_compiler_flags(language):
output = p.stdout.read() output = p.stdout.read()
output = output.decode(locale.getpreferredencoding() or 'UTF-8')
compiler_version = matcher(output).group(1) compiler_version = matcher(output).group(1)
if compiler_version and compiler_version.split('.') >= ['4', '2']: if compiler_version and compiler_version.split('.') >= ['4', '2']:
return '-fopenmp', '-fopenmp' return '-fopenmp', '-fopenmp'
locale.setlocale(locale.LC_ALL, '')
OPENMP_C_COMPILER_FLAGS = get_openmp_compiler_flags('c') OPENMP_C_COMPILER_FLAGS = get_openmp_compiler_flags('c')
OPENMP_CPP_COMPILER_FLAGS = get_openmp_compiler_flags('cpp') OPENMP_CPP_COMPILER_FLAGS = get_openmp_compiler_flags('cpp')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment