Decode command output. Fixes Python3 test cases.

This commit is contained in:
Bastian Kleineidam 2013-02-23 13:36:46 +01:00
parent 538e1d3007
commit 70fb808dae
1 changed files with 4 additions and 3 deletions

View File

@ -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):