Make a test compatible across python versions.

This commit is contained in:
Steven Malis 2019-11-13 17:11:16 -08:00
parent ded5ee0013
commit f37f423ac1
2 changed files with 2 additions and 2 deletions

View File

@ -1,2 +1,2 @@
all:
python2.7 test.py
python test.py

View File

@ -33,7 +33,7 @@ def check_lib(lib):
print('verifying if {} is an unstable crate'.format(lib['name']))
stdout, stderr = exec_command([os.environ['RUSTC'], '-', '--crate-type', 'rlib',
'--extern', '{}={}'.format(lib['name'], lib['path'])],
to_input='extern crate {};'.format(lib['name']))
to_input=('extern crate {};'.format(lib['name'])).encode('utf-8'))
if not 'use of unstable library feature' in '{}{}'.format(stdout, stderr):
print('crate {} "{}" is not unstable'.format(lib['name'], lib['path']))
print('{}{}'.format(stdout, stderr))