Decode command output. Fixes Python3 test cases.
This commit is contained in:
parent
538e1d3007
commit
70fb808dae
|
@ -114,9 +114,10 @@ class memoized (object):
|
||||||
return self.func.__doc__
|
return self.func.__doc__
|
||||||
|
|
||||||
|
|
||||||
def backtick (cmd):
|
def backtick (cmd, encoding='utf-8'):
|
||||||
"""Return output from command."""
|
"""Return decoded output from command."""
|
||||||
return subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
|
data = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0]
|
||||||
|
return data.decode(encoding)
|
||||||
|
|
||||||
|
|
||||||
def run (cmd, **kwargs):
|
def run (cmd, **kwargs):
|
||||||
|
|
Loading…
Reference in New Issue