From 3ad216bb25a87b3b5c491bc62acab3dd445bf092 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Fri, 20 Jan 2017 05:00:18 +0100 Subject: [PATCH] patchutils.py: Fix Python 3 compatibility. --- staging/patchutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/staging/patchutils.py b/staging/patchutils.py index fb9d529e..5c31438d 100644 --- a/staging/patchutils.py +++ b/staging/patchutils.py @@ -976,6 +976,7 @@ if __name__ == "__main__": os.chmod(script.name, st.st_mode | stat.S_IEXEC) result = subprocess.check_output([script.name]) + if not isinstance(result, str): result = result.decode('utf-8') self.assertEqual(result.rstrip("\n"), self.ascii) finally: os.unlink(script.name) @@ -991,6 +992,7 @@ if __name__ == "__main__": os.chmod(script.name, st.st_mode | stat.S_IEXEC) result = subprocess.check_output([script.name]) + if not isinstance(result, str): result = result.decode('utf-8') self.assertEqual(result.rstrip("\n"), self.ascii) finally: os.unlink(script.name) @@ -1013,6 +1015,7 @@ if __name__ == "__main__": subprocess.call(["gcc", source.name, "-o", compiled.name]) result = subprocess.check_output([compiled.name]) + if not isinstance(result, str): result = result.decode('utf-8') self.assertEqual(result.rstrip("\n"), self.ascii) finally: os.unlink(compiled.name)