git-changelog: Fix running on Python 3

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2019-07-02 10:26:37 +02:00
parent 46333b01ad
commit fc362c5347

View File

@ -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'))