From 436b61902115f7830683b66e16974db5e9d92f00 Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Wed, 6 Nov 2019 06:34:21 -0800 Subject: [PATCH] integrations: Use universal_newlines in check_output to output as str. Picked up by mypy; otherwise output is in bytes (at least on python 3). --- zulip/integrations/git/post-receive | 2 +- zulip/integrations/openshift/post_deploy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zulip/integrations/git/post-receive b/zulip/integrations/git/post-receive index b22db1b..8b28086 100755 --- a/zulip/integrations/git/post-receive +++ b/zulip/integrations/git/post-receive @@ -44,7 +44,7 @@ def git_commit_range(oldrev, newrev): log_cmd = ["git", "log", "--reverse", "--pretty=%aE %H %s", "%s..%s" % (oldrev, newrev)] commits = '' - for ln in subprocess.check_output(log_cmd).splitlines(): + for ln in subprocess.check_output(log_cmd, universal_newlines=True).splitlines(): author_email, commit_id, subject = ln.split(None, 2) if hasattr(config, "format_commit_message"): commits += config.format_commit_message(author_email, subject, commit_id) diff --git a/zulip/integrations/openshift/post_deploy b/zulip/integrations/openshift/post_deploy index f1a636e..495ae4c 100755 --- a/zulip/integrations/openshift/post_deploy +++ b/zulip/integrations/openshift/post_deploy @@ -27,7 +27,7 @@ def get_deployment_details(): # "gear deployments" output example: # Activation time - Deployment ID - Git Ref - Git SHA1 # 2017-01-07 15:40:30 -0500 - 9e2b7143 - master - b9ce57c - ACTIVE - dep = subprocess.check_output(['gear', 'deployments']).splitlines()[1] + dep = subprocess.check_output(['gear', 'deployments'], universal_newlines=True).splitlines()[1] splits = dep.split(' - ') return dict(app_name=os.environ['OPENSHIFT_APP_NAME'],