From fc362c534765b9ce81923def547534da62abbb29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 2 Jul 2019 10:26:37 +0200 Subject: [PATCH] git-changelog: Fix running on Python 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- git-changelog | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/git-changelog b/git-changelog index f6141e4c..4f6f4fa6 100755 --- a/git-changelog +++ b/git-changelog @@ -33,10 +33,12 @@ class ChangeLog: self.version = version def _getCommitDetail(self, commit, field): - proc = subprocess.Popen(['git', 'log', '-1', - "--pretty=format:%s" % field, commit], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate() + proc = subprocess.Popen( + ["git", "log", "-1", "--pretty=format:%s" % field, commit], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ).communicate() ret = proc[0].strip('\n').split('\n') @@ -54,10 +56,12 @@ class ChangeLog: range = "%s.." % (self.version) else: range = "%s-%s.." % (self.name, self.version) - proc = subprocess.Popen(['git', 'log', '--pretty=oneline', - '--no-merges', range], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE).communicate() + proc = subprocess.Popen( + ["git", "log", "--pretty=oneline", "--no-merges", range], + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + universal_newlines=True, + ).communicate() lines = filter(lambda x: x.find('l10n: ') != 41, proc[0].strip('\n').split('\n'))