Fix test with unicode problem in py3k
This commit is contained in:
parent
cd8d622fc9
commit
9df508f7c0
1 changed files with 11 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import subprocess
|
||||||
import tempfile
|
import tempfile
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
|
is_py3k = sys.version_info[0] >= 3
|
||||||
BITS = tuple.__itemsize__ * 8
|
BITS = tuple.__itemsize__ * 8
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
@ -711,6 +712,9 @@ class TestNative(TestCase):
|
||||||
|
|
||||||
src = os.path.join(self.tmpdir, 'llvmasm.s')
|
src = os.path.join(self.tmpdir, 'llvmasm.s')
|
||||||
with open(src, 'wb') as fout:
|
with open(src, 'wb') as fout:
|
||||||
|
if is_py3k:
|
||||||
|
fout.write(output.encode('utf-8'))
|
||||||
|
else:
|
||||||
fout.write(output)
|
fout.write(output)
|
||||||
|
|
||||||
self._compile(src)
|
self._compile(src)
|
||||||
|
|
@ -725,8 +729,12 @@ class TestNative(TestCase):
|
||||||
|
|
||||||
src = os.path.join(self.tmpdir, 'llvmobj.o')
|
src = os.path.join(self.tmpdir, 'llvmobj.o')
|
||||||
with open(src, 'wb') as fout:
|
with open(src, 'wb') as fout:
|
||||||
|
if is_py3k:
|
||||||
|
fout.write(output.encode('utf-8'))
|
||||||
|
else:
|
||||||
fout.write(output)
|
fout.write(output)
|
||||||
|
|
||||||
|
|
||||||
self._compile(src)
|
self._compile(src)
|
||||||
|
|
||||||
if sys.platform != 'win32':
|
if sys.platform != 'win32':
|
||||||
|
|
@ -965,7 +973,7 @@ class TestCPUSupport(TestCase):
|
||||||
features = []
|
features = []
|
||||||
from llvm.workaround.avx_support import detect_avx_support
|
from llvm.workaround.avx_support import detect_avx_support
|
||||||
if not detect_avx_support():
|
if not detect_avx_support():
|
||||||
print 'Skipping: no AVX'
|
print('Skipping: no AVX')
|
||||||
else:
|
else:
|
||||||
mattrs = ','.join(map(lambda s: '-%s' % s, features))
|
mattrs = ','.join(map(lambda s: '-%s' % s, features))
|
||||||
print('disable mattrs', mattrs)
|
print('disable mattrs', mattrs)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue