Fix some compatibility issues with Python3
This commit is contained in:
parent
fc4e1a8529
commit
8f47f1dde7
@ -14,7 +14,6 @@
|
|||||||
#
|
#
|
||||||
# Author: Bruno Goncalves <bgoncalv@redhat.com>
|
# Author: Bruno Goncalves <bgoncalv@redhat.com>
|
||||||
|
|
||||||
from os import walk
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
@ -25,7 +24,10 @@ def run(cmd):
|
|||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
|
|
||||||
retcode = p.returncode
|
retcode = p.returncode
|
||||||
output = stdout + stderr
|
output = stdout.decode('ascii', 'ignore') + stderr.decode('ascii', 'ignore')
|
||||||
|
|
||||||
|
# remove new line from last line
|
||||||
|
output = output.rstrip()
|
||||||
print(output)
|
print(output)
|
||||||
return retcode, output
|
return retcode, output
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user