From efd187e955abe996ba850a32e3cda03823549a6b Mon Sep 17 00:00:00 2001 From: "Elf M. Sternberg" Date: Thu, 29 Sep 2016 16:02:55 -0700 Subject: [PATCH] Python 3 compatibility tests passing. --- git_lint/option_handler.py | 1 + tests/test_git_lint.py | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/git_lint/option_handler.py b/git_lint/option_handler.py index 57738d7..d8fe489 100644 --- a/git_lint/option_handler.py +++ b/git_lint/option_handler.py @@ -1,6 +1,7 @@ # Copyright (C) 2015 Elf M. Sternberg # Author: Elf M. Sternberg +from functools import reduce import getopt # This was a lot shorter and smarter in Hy... diff --git a/tests/test_git_lint.py b/tests/test_git_lint.py index 8419357..de820fc 100644 --- a/tests/test_git_lint.py +++ b/tests/test_git_lint.py @@ -55,16 +55,19 @@ condition = error # to not have a '.git' directory somewhere lurking in a parent folder. def shell(cmd, environment=environment): - return subprocess.check_call(cmd, shell=True, env=environment) + return subprocess.check_call(cmd, shell=True, env=environment, + universal_newlines=True) def outshell(cmd, environment=environment): - return subprocess.check_output(cmd, shell=True, env=environment) + return subprocess.check_output(cmd, shell=True, env=environment, + universal_newlines=True) def fullshell(cmd, environment=environment): process = subprocess.Popen(cmd, shell=True, env=environment, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout=subprocess.PIPE, stderr=subprocess.PIPE, + universal_newlines=True) (stdout, stderr) = process.communicate() return (stdout, stderr, process.returncode)