Fix vulture output for Python 3.

This commit is contained in:
Andris Raugulis 2017-03-25 08:33:16 +02:00
parent 8b7659c4d3
commit cfae0d020a

View File

@ -77,8 +77,8 @@ commands =
python -c "import sys; from subprocess import Popen, PIPE; \
a = ['vulture'] + r'{posargs:{env:SSHAUDIT}}'.split(' '); \
o = Popen(a, shell=False, stdout=PIPE).communicate()[0]; \
l = [x for x in o.split('\n') if x and 'Unused import' not in x]; \
print('\n'.join(l)); \
l = [x for x in o.split(b'\n') if x and b'Unused import' not in x]; \
print(b'\n'.join(l).decode('utf-8')); \
sys.exit(1 if len(l) > 0 else 0)"
[testenv:type]