From 49433ad7f88ee201999577eca5cb2a031be5a431 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 31 2016 12:35:03 +0000 Subject: Fix tests on Python 2.6 check_output was only added to subprocess in 2.7 Signed-off-by: Lubomír Sedlář --- diff --git a/test/test_retire.py b/test/test_retire.py index e824428..af48ece 100644 --- a/test/test_retire.py +++ b/test/test_retire.py @@ -40,8 +40,10 @@ class RetireTestCase(unittest.TestCase): cwd=self.tmpdir, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def _get_latest_commit(self): - return subprocess.check_output( - ['git', 'log', '-n', '1', '--pretty=%s'], cwd=self.tmpdir).strip() + proc = subprocess.Popen(['git', 'log', '-n', '1', '--pretty=%s'], + cwd=self.tmpdir, stdout=subprocess.PIPE) + out, err = proc.communicate() + return out.strip() def _fake_client(self, args): config = ConfigParser.SafeConfigParser()